[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp DwarfWriter.cpp

Jim Laskey jlaskey at apple.com
Tue Oct 17 06:41:24 PDT 2006



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.109 -> 1.110
DwarfWriter.cpp updated: 1.80 -> 1.81
---
Log message:

Basic support for getGlobalLinkName.

---
Diffs of the changes:  (+12 -2)

 AsmPrinter.cpp  |   10 ++++++++++
 DwarfWriter.cpp |    4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.109 llvm/lib/CodeGen/AsmPrinter.cpp:1.110
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.109	Tue Oct 10 23:29:42 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Tue Oct 17 08:41:07 2006
@@ -349,6 +349,16 @@
   return Alignment;
 }
 
+/// getGlobalLinkName - Returns the asm/link name of of the specified
+/// global variable.  Should be overridden by each target asm printer to
+/// generate the appropriate value.
+void AsmPrinter::getGlobalLinkName(const GlobalVariable *GV,
+                                  std::string &LinkName) {
+  // Default action is to use a global symbol.                              
+  LinkName = TAI->getGlobalPrefix();
+  LinkName += GV->getName();
+}
+
 // EmitAlignment - Emit an alignment directive to the specified power of two.
 void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV) const {
   if (GV && GV->getAlignment())


Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.80 llvm/lib/CodeGen/DwarfWriter.cpp:1.81
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.80	Mon Oct 16 14:38:41 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp	Tue Oct 17 08:41:07 2006
@@ -1634,8 +1634,8 @@
   AddSourceLine(VariableDie, UnitDesc, GVD->getLine());
   
   // Work up linkage name.
-  std::string LinkageName(TAI->getGlobalPrefix());
-  LinkageName += GV->getName();
+  std::string LinkageName;
+  Asm->getGlobalLinkName(GV, LinkageName);
 
   // Add address.
   DIEBlock *Block = new DIEBlock();






More information about the llvm-commits mailing list