switch liblto to use the new getNameWithPrefix() method instead of getMangledName.
authorChris Lattner <sabre@nondot.org>
Sat, 16 Jan 2010 18:12:14 +0000 (18:12 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 16 Jan 2010 18:12:14 +0000 (18:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93643 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Mangler.h
tools/bugpoint/Miscompilation.cpp
tools/lto/LTOCodeGenerator.cpp
tools/lto/LTOModule.cpp

index 252a707699c7f20440b5cc8365bf2f1e09dcc9d0..e0ad6ddede8c04437322b756bfc661b0fd6ae2ec 100644 (file)
@@ -123,7 +123,8 @@ public:
   /// getNameWithPrefix - Return the name of the appropriate prefix
   /// and the specified global variable's name.  If the global variable doesn't
   /// have a name, this fills in a unique name for the global.
-  std::string getNameWithPrefix(const GlobalValue *GV,bool isImplicitlyPrivate);
+  std::string getNameWithPrefix(const GlobalValue *GV,
+                                bool isImplicitlyPrivate = false);
   
 private:
   /// makeNameProper - We don't want identifier names with ., space, or
index a5914178f12e769439bada34e7ebe48ab4d65813..92bf1437d50bec81fe26ccb594e0aa210c8e29a0 100644 (file)
@@ -251,13 +251,13 @@ static void DisambiguateGlobalSymbols(Module *M) {
        I != E; ++I) {
     // Don't mangle asm names.
     if (!I->hasName() || I->getName()[0] != 1)
-      I->setName(Mang.getMangledName(I));
+      I->setName(Mang.getNameWithPrefix(I));
   }
   for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
     // Don't mangle asm names or intrinsics.
     if ((!I->hasName() || I->getName()[0] != 1) &&
         I->getIntrinsicID() == 0)
-      I->setName(Mang.getMangledName(I));
+      I->setName(Mang.getNameWithPrefix(I));
   }
 }
 
index af8604384485f97aee75f514162a33cc5c7d0a45..1ea419a918bd9fbebb14d4a198a19d8f381492c8 100644 (file)
@@ -329,7 +329,7 @@ void LTOCodeGenerator::applyScopeRestrictions()
             for (Module::iterator f = mergedModule->begin(), 
                                         e = mergedModule->end(); f != e; ++f) {
                 if ( !f->isDeclaration() 
-                  && _mustPreserveSymbols.count(mangler.getMangledName(f)) )
+                  && _mustPreserveSymbols.count(mangler.getNameWithPrefix(f)) )
                   mustPreserveList.push_back(::strdup(f->getNameStr().c_str()));
             }
             for (Module::global_iterator v = mergedModule->global_begin(), 
index bce416207c40dd527e11f3f65c93af8ae2056c80..a3a477fed9a84fe1778ed1cfec3c951dfb0cae0f 100644 (file)
@@ -320,7 +320,7 @@ void LTOModule::addDefinedSymbol(GlobalValue* def, Mangler &mangler,
         return;
 
     // string is owned by _defines
-    const char* symbolName = ::strdup(mangler.getMangledName(def).c_str());
+    const char* symbolName = ::strdup(mangler.getNameWithPrefix(def).c_str());
 
     // set alignment part log2() can have rounding errors
     uint32_t align = def->getAlignment();
@@ -393,7 +393,7 @@ void LTOModule::addPotentialUndefinedSymbol(GlobalValue* decl, Mangler &mangler)
     if (isa<GlobalAlias>(decl))
         return;
 
-    std::string name = mangler.getMangledName(decl);
+    std::string name = mangler.getNameWithPrefix(decl);
 
     // we already have the symbol
     if (_undefines.find(name) != _undefines.end())