eliminate uses of getMangledName from AsmPrinter.cpp, last up is
authorChris Lattner <sabre@nondot.org>
Sat, 16 Jan 2010 18:17:26 +0000 (18:17 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 16 Jan 2010 18:17:26 +0000 (18:17 +0000)
dwarf emission which is going to be more invasive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93645 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index ed6ccec0c578bdbcf8a1419906aa45640575104a..c83a0dae9621144593b264124fc20200d9597d22 100644 (file)
@@ -163,13 +163,17 @@ bool AsmPrinter::doFinalization(Module &M) {
     // Print out module-level global variables here.
     for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
          I != E; ++I) {
-      if (I->hasExternalWeakLinkage())
-        O << MAI->getWeakRefDirective() << Mang->getMangledName(I) << '\n';
+      if (!I->hasExternalWeakLinkage()) continue;
+      O << MAI->getWeakRefDirective();
+      GetGlobalValueSymbol(I)->print(O, MAI);
+      O << '\n';
     }
     
     for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I) {
-      if (I->hasExternalWeakLinkage())
-        O << MAI->getWeakRefDirective() << Mang->getMangledName(I) << '\n';
+      if (!I->hasExternalWeakLinkage()) continue;
+      O << MAI->getWeakRefDirective();
+      GetGlobalValueSymbol(I)->print(O, MAI);
+      O << '\n';
     }
   }
 
@@ -828,7 +832,7 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) {
   if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
     // This is a constant address for a global variable or function. Use the
     // name of the variable or function as the address value.
-    O << Mang->getMangledName(GV);
+    GetGlobalValueSymbol(GV)->print(O, MAI);
     return;
   }