From 877354a2f73393af27f76c4dd4550b4ff839472f Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 14 Apr 2015 18:08:25 +0000 Subject: DebugInfo: Pubnames: Do not include variable declarations in pubnames This causes badness for GDB which expects to find a definition in any compile_unit that has an entry for the variable in its pubnames. llvm-svn: 234915 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 555d40bb8c2..d3097a16cc5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -137,6 +137,8 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(DIGlobalVariable GV) { if (!GV->isDefinition()) addFlag(*VariableDIE, dwarf::DW_AT_declaration); + else + addGlobalName(GV->getName(), *VariableDIE, DeclContext); // Add location. bool addToAccelTable = false; @@ -202,7 +204,6 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(DIGlobalVariable GV) { DD->addAccelName(GV->getLinkageName(), *VariableDIE); } - addGlobalName(GV->getName(), *VariableDIE, DeclContext); return VariableDIE; } -- cgit v1.2.3