From d7f53cdaecdc931c623104bd01ec31a2b8a13dc4 Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Mon, 20 Nov 2006 20:29:06 +0000 Subject: Global label not handled correctly. llvm-svn: 31883 --- llvm/lib/CodeGen/AsmPrinter.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 9454fe5beb1..c2f5d7334c9 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/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(GV)) { + LinkName += TAI->getFunctionAddrPrefix(); + LinkName += Mang->getValueName(GV); + LinkName += TAI->getFunctionAddrSuffix(); + } else { + LinkName += TAI->getGlobalVarAddrPrefix(); + LinkName += Mang->getValueName(GV); + LinkName += TAI->getGlobalVarAddrSuffix(); + } + return LinkName; } -- cgit v1.2.3