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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-04-14 18:08:25 +00:00
parent 391cd7a655
commit 8b37471825
2 changed files with 103 additions and 70 deletions

View File

@ -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;
}