From: Sanjiv Gupta Date: Wed, 14 Oct 2009 15:08:34 +0000 (+0000) Subject: Few targets like PIC16 mangle the names of global variables, so retrieve the name X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d7bc3e59517bf42ae855669c55844d868f4b21a;p=clang Few targets like PIC16 mangle the names of global variables, so retrieve the name 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 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index bbe113b931..4c624205b4 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -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()) {