summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-05 23:22:08 +0000
committerDevang Patel <dpatel@apple.com>2009-10-05 23:22:08 +0000
commit4144a821549f8b17bcf2a8aaab15f1497fb9e840 (patch)
tree59abbb6d6d4934c66f9f3689bfc3c62af043f8a7 /llvm/lib/CodeGen
parent916c00673572f8632c3cb6d085dd16b5dd5271dc (diff)
downloadbcm5719-llvm-4144a821549f8b17bcf2a8aaab15f1497fb9e840.tar.gz
bcm5719-llvm-4144a821549f8b17bcf2a8aaab15f1497fb9e840.zip
Set address while constructing DIE.
llvm-svn: 83343
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index e364c0d9bce..7614c481c91 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1107,6 +1107,14 @@ DIE *DwarfDebug::CreateGlobalVariableDIE(CompileUnit *DW_Unit,
if (!GV.isLocalToUnit())
AddUInt(GVDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1);
AddSourceLine(GVDie, &GV);
+
+ // Add address.
+ DIEBlock *Block = new DIEBlock();
+ AddUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr);
+ AddObjectLabel(Block, 0, dwarf::DW_FORM_udata,
+ Asm->Mang->getMangledName(GV.getGlobal()));
+ AddBlock(GVDie, dwarf::DW_AT_location, 0, Block);
+
return GVDie;
}
@@ -1582,13 +1590,6 @@ void DwarfDebug::ConstructGlobalVariableDIE(MDNode *N) {
DIE *VariableDie = CreateGlobalVariableDIE(ModuleCU, DI_GV);
- // Add address.
- DIEBlock *Block = new DIEBlock();
- AddUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr);
- AddObjectLabel(Block, 0, dwarf::DW_FORM_udata,
- Asm->Mang->getMangledName(DI_GV.getGlobal()));
- AddBlock(VariableDie, dwarf::DW_AT_location, 0, Block);
-
// Add to map.
Slot = VariableDie;
OpenPOWER on IntegriCloud