diff options
author | Eric Christopher <echristo@gmail.com> | 2013-10-16 01:37:49 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-10-16 01:37:49 +0000 |
commit | d2b497b522c3b2524518aac1283da508e88d7700 (patch) | |
tree | 73fb0a7130931604b3d00cbcbe577952ad86da67 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 43c4e24fad22d847b8345331a66e3397216f650e (diff) | |
download | bcm5719-llvm-d2b497b522c3b2524518aac1283da508e88d7700.tar.gz bcm5719-llvm-d2b497b522c3b2524518aac1283da508e88d7700.zip |
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.
llvm-svn: 192761
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 732db20943e..b6ea6a4166d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -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. |