aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-11-20 20:29:06 +0000
committerJim Laskey <jlaskey@mac.com>2006-11-20 20:29:06 +0000
commit0374248e86f66231ff5f07e6bce14e3dd67abd14 (patch)
tree1a14991248c6f5acee78647557aa56ed45d91275 /lib/CodeGen/AsmPrinter.cpp
parentbdc571b7d578091059aa7bc5c3a190ceb70f9542 (diff)
Global label not handled correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 9454fe5beb..c2f5d7334c 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -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;
}