[llvm-commits] [llvm] r144130 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfCompileUnit.cpp DwarfDebug.cpp

Eric Christopher echristo at apple.com
Tue Nov 8 13:56:23 PST 2011


Author: echristo
Date: Tue Nov  8 15:56:23 2011
New Revision: 144130

URL: http://llvm.org/viewvc/llvm-project?rev=144130&view=rev
Log:
Also add the linkage name to the name accelerator tables if it exists
and is different than the normal name.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=144130&r1=144129&r2=144130&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Nov  8 15:56:23 2011
@@ -1131,6 +1131,11 @@
   if (addToAccelTable)
     addAccelName(GV.getName(), VariableDIE);
 
+  // If the linkage name is different than the name, go ahead and output
+  // that as well into the name table.
+  if (GV.getLinkageName() != "" && GV.getName() != GV.getLinkageName())
+    addAccelName(GV.getLinkageName(), VariableDIE);
+
   return;
 }
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=144130&r1=144129&r2=144130&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Nov  8 15:56:23 2011
@@ -441,8 +441,15 @@
   if (DS.isSubprogram())
    TheCU->addPubTypes(DISubprogram(DS));
 
-  if (DS.isSubprogram() && !Scope->isAbstractScope())
-    TheCU->addAccelName(DISubprogram(DS).getName(), ScopeDIE);
+  if (DS.isSubprogram() && !Scope->isAbstractScope()) {
+    DISubprogram SP = DISubprogram(DS);
+    TheCU->addAccelName(SP.getName(), ScopeDIE);
+
+    // If the linkage name is different than the name, go ahead and output
+    // that as well into the name table.
+    if (SP.getLinkageName() != "" && SP.getName() != SP.getLinkageName())
+      TheCU->addAccelName(SP.getLinkageName(), ScopeDIE);
+  }
 
  return ScopeDIE;
 }
@@ -596,6 +603,11 @@
   // Add to Accel Names
   TheCU->addAccelName(SP.getName(), SubprogramDie);
 
+  // If the linkage name is different than the name, go ahead and output
+  // that as well into the name table.
+  if (SP.getLinkageName() != "" && SP.getName() != SP.getLinkageName())
+    TheCU->addAccelName(SP.getLinkageName(), SubprogramDie);
+
   // If this is an Objective-C selector name add it to the ObjC accelerator too.
   if (isObjCClass(SP.getName())) {
     StringRef Class, Category;





More information about the llvm-commits mailing list