diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-11-20 20:29:06 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-11-20 20:29:06 +0000 |
commit | 0374248e86f66231ff5f07e6bce14e3dd67abd14 (patch) | |
tree | 1a14991248c6f5acee78647557aa56ed45d91275 /lib/CodeGen/AsmPrinter.cpp | |
parent | bdc571b7d578091059aa7bc5c3a190ceb70f9542 (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.cpp | 14 |
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; } |