diff options
| author | Yong He <yonghe@outlook.com> | 2018-02-22 15:08:47 -0500 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2018-02-22 15:09:50 -0500 |
| commit | ac1dfba8dd758febaf93f43e600d5542da6cd3e4 (patch) | |
| tree | e36f6af482f21889c1155d3a0fd37d318a36c88c /source/slang/lower-to-ir.cpp | |
| parent | 7eaaf1aa1fdac3fd7ff7b64800a965a2b2c17f66 (diff) | |
Make `IRGlobalValue::mangledName` a `Name*`
This allows us to get rid of `IRGlobalValue::dispose()`.
Diffstat (limited to 'source/slang/lower-to-ir.cpp')
| -rw-r--r-- | source/slang/lower-to-ir.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp index 8c858f4f3..fde52d2e3 100644 --- a/source/slang/lower-to-ir.cpp +++ b/source/slang/lower-to-ir.cpp @@ -2812,7 +2812,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> { for (auto subInheritanceDeclRef : getMembersOfType<InheritanceDecl>(baseInterfaceDeclRef)) { - auto cpyMangledName = getMangledNameForConformanceWitness(subType, subInheritanceDeclRef.getDecl()->getSup().type); + auto cpyMangledName = context->getSession()->getNameObj(getMangledNameForConformanceWitness(subType, subInheritanceDeclRef.getDecl()->getSup().type)); if (!witnessTablesDictionary.ContainsKey(cpyMangledName)) { auto cpyTable = context->irBuilder->createWitnessTable(); @@ -2820,14 +2820,14 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> context->irBuilder->createWitnessTableEntry(witnessTable, context->irBuilder->getDeclRefVal(subInheritanceDeclRef), cpyTable); cpyTable->entries = witnessTable->entries; - witnessTablesDictionary.Add(cpyMangledName, cpyTable); + witnessTablesDictionary.Add(cpyTable->mangledName, cpyTable); walkInheritanceHierarchyAndCreateWitnessTableCopies(witnessTable, subType, subInheritanceDeclRef.getDecl()); } } } } - Dictionary<String, IRWitnessTable*> witnessTablesDictionary; + Dictionary<Name*, IRWitnessTable*> witnessTablesDictionary; LoweredValInfo visitInheritanceDecl(InheritanceDecl* inheritanceDecl) { @@ -2859,7 +2859,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> // Construct the mangled name for the witness table, which depends // on the type that is conforming, and the type that it conforms to. - String mangledName = getMangledNameForConformanceWitness(type, superType); + auto mangledName = context->getSession()->getNameObj(getMangledNameForConformanceWitness(type, superType)); // Build an IR level witness table, which will represent the // conformance of the type to its super-type. @@ -2999,7 +2999,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> irGlobal = builder->createGlobalVar(varType); globalVal = LoweredValInfo::ptr(irGlobal); } - irGlobal->mangledName = getMangledName(decl); + irGlobal->mangledName = context->getSession()->getNameObj(getMangledName(decl)); if (decl) { @@ -3458,7 +3458,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> String mangledName = getMangledName(decl); - irFunc->mangledName = mangledName; + irFunc->mangledName = context->getSession()->getNameObj(mangledName); } ModuleDecl* findModuleDecl(Decl* decl) |
