Fix a pair of bugs in the emission of pubname tables:

1) Make sure we emit static member variables by checking
at the end of createGlobalVariableDIE rather than piecemeal
in the function.
(As a note, createGlobalVariableDIE needs rewriting.)

2) Make sure we use the definition rather than declaration DIE
for two things: a) determining linkage for gnu pubnames, and b)
as the address of the DIE for global variables.
(As a note, createGlobalVariableDIE really needs rewriting.)

Adjust the testcase to make sure we're checking the correct DIEs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192761 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2013-10-16 01:37:49 +00:00
parent 06957f43f6
commit a486f55569
3 changed files with 62 additions and 29 deletions

View File

@ -1472,10 +1472,8 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
addType(VariableDIE, GTy);
// Add scoping info.
if (!GV.isLocalToUnit()) {
if (!GV.isLocalToUnit())
addFlag(VariableDIE, dwarf::DW_AT_external);
addGlobalName(GV.getName(), VariableDIE);
}
// Add line number info.
addSourceLine(VariableDIE, GV);
@ -1568,6 +1566,10 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
if (GV.getLinkageName() != "" && GV.getName() != GV.getLinkageName())
addAccelName(GV.getLinkageName(), AddrDIE);
}
if (!GV.isLocalToUnit())
addGlobalName(GV.getName(),
VariableSpecDIE ? VariableSpecDIE : VariableDIE);
}
/// constructSubrangeDIE - Construct subrange DIE from DISubrange.