From ac1dfba8dd758febaf93f43e600d5542da6cd3e4 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 22 Feb 2018 15:08:47 -0500 Subject: Make `IRGlobalValue::mangledName` a `Name*` This allows us to get rid of `IRGlobalValue::dispose()`. --- source/slang/lower-to-ir.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/slang/lower-to-ir.cpp') 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 { for (auto subInheritanceDeclRef : getMembersOfType(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 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 witnessTablesDictionary; + Dictionary witnessTablesDictionary; LoweredValInfo visitInheritanceDecl(InheritanceDecl* inheritanceDecl) { @@ -2859,7 +2859,7 @@ struct DeclLoweringVisitor : DeclVisitor // 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 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 String mangledName = getMangledName(decl); - irFunc->mangledName = mangledName; + irFunc->mangledName = context->getSession()->getNameObj(mangledName); } ModuleDecl* findModuleDecl(Decl* decl) -- cgit v1.2.3