Global label not handled correctly.
authorJim Laskey <jlaskey@mac.com>
Mon, 20 Nov 2006 20:29:06 +0000 (20:29 +0000)
committerJim Laskey <jlaskey@mac.com>
Mon, 20 Nov 2006 20:29:06 +0000 (20:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31883 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp

index 9454fe5beb16e501ce645ec4fa84d40a458cff35..c2f5d7334c904f2d872bbaaeb6781791f08c5aff 100644 (file)
@@ -334,9 +334,17 @@ void AsmPrinter::EmitXXStructorList(Constant *List) {
 /// generate the appropriate value.
 const std::string AsmPrinter::getGlobalLinkName(const GlobalVariable *GV) const{
   std::string LinkName;
-  // Default action is to use a global symbol.                              
-  LinkName = TAI->getGlobalPrefix();
-  LinkName += GV->getName();
+  
+  if (isa<Function>(GV)) {
+    LinkName += TAI->getFunctionAddrPrefix();
+    LinkName += Mang->getValueName(GV);
+    LinkName += TAI->getFunctionAddrSuffix();
+  } else {
+    LinkName += TAI->getGlobalVarAddrPrefix();
+    LinkName += Mang->getValueName(GV);
+    LinkName += TAI->getGlobalVarAddrSuffix();
+  }  
+  
   return LinkName;
 }