summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-01-15 01:12:22 +0000
committerDevang Patel <dpatel@apple.com>2010-01-15 01:12:22 +0000
commit89880c82247782e8becb7898f41d2fa48f4b1a35 (patch)
tree7a8d967fddd15478948f2792137c27e81a1a0191 /llvm/lib
parentfc4daba5e084874f801803db8373707593e5db5b (diff)
downloadbcm5719-llvm-89880c82247782e8becb7898f41d2fa48f4b1a35.tar.gz
bcm5719-llvm-89880c82247782e8becb7898f41d2fa48f4b1a35.zip
Do not use AT_specification die for static variables. It confuses gdb.
llvm-svn: 93494
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index af8366afabe..15f37aec148 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1653,8 +1653,11 @@ void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
ModuleCU->insertDIE(N, VariableDie);
// Add to context owner.
- if (DI_GV.isDefinition()
- && !DI_GV.getContext().isCompileUnit()) {
+ DIDescriptor GVContext = DI_GV.getContext();
+ // Do not create specification DIE if context is either compile unit
+ // or a subprogram.
+ if (DI_GV.isDefinition() && !GVContext.isCompileUnit()
+ && !GVContext.isSubprogram()) {
// Create specification DIE.
DIE *VariableSpecDIE = new DIE(dwarf::DW_TAG_variable);
addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification,
@@ -1672,7 +1675,7 @@ void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
Asm->Mang->getMangledName(DI_GV.getGlobal()));
addBlock(VariableDie, dwarf::DW_AT_location, 0, Block);
}
- addToContextOwner(VariableDie, DI_GV.getContext());
+ addToContextOwner(VariableDie, GVContext);
// Expose as global. FIXME - need to check external flag.
ModuleCU->addGlobal(DI_GV.getName(), VariableDie);
OpenPOWER on IntegriCloud