]> granicus.if.org Git - clang/commitdiff
Targets (like pic16) may have mangled the name of global variables,
authorSanjiv Gupta <sanjiv.gupta@microchip.com>
Thu, 25 Feb 2010 05:20:44 +0000 (05:20 +0000)
committerSanjiv Gupta <sanjiv.gupta@microchip.com>
Thu, 25 Feb 2010 05:20:44 +0000 (05:20 +0000)
so get the name from Var rather than the original decl.

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

lib/CodeGen/CGDebugInfo.cpp

index 9ed6466af6a58c50870a150629066d97e34fdc61..0f3502e9bea3ebd99db0958bd55fdaff0db46b7e 100644 (file)
@@ -1692,7 +1692,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
     T = CGM.getContext().getConstantArrayType(ET, ConstVal,
                                            ArrayType::Normal, 0);
   }
-  llvm::StringRef DeclName = D->getName();
+  llvm::StringRef DeclName = Var->getName();
   llvm::DIDescriptor DContext = 
     getContextDescriptor(dyn_cast<Decl>(D->getDeclContext()), Unit);
   DebugFactory.CreateGlobalVariable(DContext, DeclName,