[llvm-commits] [llvm] r93643 - in /llvm/trunk: include/llvm/Support/Mangler.h tools/bugpoint/Miscompilation.cpp tools/lto/LTOCodeGenerator.cpp tools/lto/LTOModule.cpp

Chris Lattner sabre at nondot.org
Sat Jan 16 10:12:14 PST 2010


Author: lattner
Date: Sat Jan 16 12:12:14 2010
New Revision: 93643

URL: http://llvm.org/viewvc/llvm-project?rev=93643&view=rev
Log:
switch liblto to use the new getNameWithPrefix() method instead of getMangledName.

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

Modified: llvm/trunk/include/llvm/Support/Mangler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Mangler.h?rev=93643&r1=93642&r2=93643&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/Mangler.h (original)
+++ llvm/trunk/include/llvm/Support/Mangler.h Sat Jan 16 12:12:14 2010
@@ -123,7 +123,8 @@
   /// 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

Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=93643&r1=93642&r2=93643&view=diff

==============================================================================
--- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
+++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Sat Jan 16 12:12:14 2010
@@ -251,13 +251,13 @@
        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));
   }
 }
 

Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=93643&r1=93642&r2=93643&view=diff

==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Sat Jan 16 12:12:14 2010
@@ -329,7 +329,7 @@
             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(), 

Modified: llvm/trunk/tools/lto/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=93643&r1=93642&r2=93643&view=diff

==============================================================================
--- llvm/trunk/tools/lto/LTOModule.cpp (original)
+++ llvm/trunk/tools/lto/LTOModule.cpp Sat Jan 16 12:12:14 2010
@@ -320,7 +320,7 @@
         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 @@
     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())





More information about the llvm-commits mailing list