]> granicus.if.org Git - clang/commitdiff
Few targets like PIC16 mangle the names of global variables, so retrieve the name
authorSanjiv Gupta <sanjiv.gupta@microchip.com>
Wed, 14 Oct 2009 15:08:34 +0000 (15:08 +0000)
committerSanjiv Gupta <sanjiv.gupta@microchip.com>
Wed, 14 Oct 2009 15:08:34 +0000 (15:08 +0000)
from Var itself rather than the decl for DebugInfo metadata.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84102 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index bbe113b93128e1a3ceacb8516cdbdbfd6fa46eae..4c624205b4cac62f824728d19d34d048086b1345 100644 (file)
@@ -1350,7 +1350,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
   PresumedLoc PLoc = SM.getPresumedLoc(Decl->getLocation());
   unsigned LineNo = PLoc.isInvalid() ? 0 : PLoc.getLine();
 
-  std::string Name = Decl->getNameAsString();
+  std::string Name = Var->getName();
 
   QualType T = Decl->getType();
   if (T->isIncompleteArrayType()) {