[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Jim Laskey
jlaskey at apple.com
Mon Nov 20 12:29:21 PST 2006
Changes in directory llvm/lib/CodeGen:
AsmPrinter.cpp updated: 1.116 -> 1.117
---
Log message:
Global label not handled correctly.
---
Diffs of the changes: (+11 -3)
AsmPrinter.cpp | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.116 llvm/lib/CodeGen/AsmPrinter.cpp:1.117
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.116 Wed Nov 1 03:23:08 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp Mon Nov 20 14:29:06 2006
@@ -334,9 +334,17 @@
/// 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;
}
More information about the llvm-commits
mailing list