summaryrefslogtreecommitdiffstats
path: root/source/slang/ir-legalize-types.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-02-22 15:08:47 -0500
committerYong He <yonghe@outlook.com>2018-02-22 15:09:50 -0500
commitac1dfba8dd758febaf93f43e600d5542da6cd3e4 (patch)
treee36f6af482f21889c1155d3a0fd37d318a36c88c /source/slang/ir-legalize-types.cpp
parent7eaaf1aa1fdac3fd7ff7b64800a965a2b2c17f66 (diff)
Make `IRGlobalValue::mangledName` a `Name*`
This allows us to get rid of `IRGlobalValue::dispose()`.
Diffstat (limited to 'source/slang/ir-legalize-types.cpp')
-rw-r--r--source/slang/ir-legalize-types.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/slang/ir-legalize-types.cpp b/source/slang/ir-legalize-types.cpp
index 9cb32de8f..3a0edbb60 100644
--- a/source/slang/ir-legalize-types.cpp
+++ b/source/slang/ir-legalize-types.cpp
@@ -14,6 +14,7 @@
#include "ir-insts.h"
#include "legalize-types.h"
#include "mangle.h"
+#include "name.h"
namespace Slang
{
@@ -111,14 +112,13 @@ static void maybeRegisterLegalizedGlobal(
// Check the mangled name of the symbol and don't register
// symbols that don't have an external name (currently
// indicated by them having an empty name string).
- String mangledName = irGlobalVar->mangledName;
- if (mangledName.Length() == 0)
+ if (getText(irGlobalVar->mangledName).Length() == 0)
return;
// Otherwise, register the legalized value for this symbol
// under its mangled name, so that other code can still
// find the right value(s) to use after legalization.
- context->typeLegalizationContext->mapMangledNameToLegalIRValue.AddIfNotExists(mangledName, legalVal);
+ context->typeLegalizationContext->mapMangledNameToLegalIRValue.AddIfNotExists(irGlobalVar->mangledName, legalVal);
}
struct IRGlobalNameInfo
@@ -893,12 +893,12 @@ static LegalVal declareSimpleVar(
// a counter to each leaf variable generated from the original
if (globalNameInfo)
{
- String mangledName = globalNameInfo->globalVar->mangledName;
- if (mangledName.Length() != 0)
+ String mangledNameStr = getText(globalNameInfo->globalVar->mangledName);
+ if (mangledNameStr.Length() != 0)
{
- mangledName.append("L");
- mangledName.append(globalNameInfo->counter++);
- globalVar->mangledName = mangledName;
+ mangledNameStr.append("L");
+ mangledNameStr.append(globalNameInfo->counter++);
+ globalVar->mangledName = context->session->getNameObj(mangledNameStr);
}
}