diff options
author | Eric Christopher <echristo@gmail.com> | 2013-12-30 03:40:32 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-12-30 03:40:32 +0000 |
commit | d039baad058bcc56899374f646dd475aa3663050 (patch) | |
tree | 081b652286c8056a5219299dcfc445c21b6ccb24 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | |
parent | 62588e1a8608d919f27a3cfdc3264b6bd1a4f92d (diff) | |
download | bcm5719-llvm-d039baad058bcc56899374f646dd475aa3663050.tar.gz bcm5719-llvm-d039baad058bcc56899374f646dd475aa3663050.zip |
Reapply r198196 with a fix to zero initialize the skeleton pointer.
llvm-svn: 198199
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 693e37ffe8d..75c9580ea30 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -43,7 +43,7 @@ GenerateDwarfTypeUnits("generate-type-units", cl::Hidden, DwarfUnit::DwarfUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU) : UniqueID(UID), Node(Node), UnitDie(D), DebugInfoOffset(0), Asm(A), DD(DW), - DU(DWU), IndexTyDie(0), Section(0) { + DU(DWU), IndexTyDie(0), Section(0), Skeleton(0) { DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1); } @@ -293,6 +293,23 @@ void DwarfCompileUnit::addLabelAddress(DIE *Die, dwarf::Attribute Attribute, } } +/// addLocalLabelAddress - Add a dwarf label attribute data and value using +/// DW_FORM_addr. +void DwarfCompileUnit::addLocalLabelAddress(DIE *Die, + dwarf::Attribute Attribute, + MCSymbol *Label) { + if (Label) + DD->addArangeLabel(SymbolCU(this, Label)); + + if (Label != NULL) { + DIEValue *Value = new (DIEValueAllocator) DIELabel(Label); + Die->addValue(Attribute, dwarf::DW_FORM_addr, Value); + } else { + DIEValue *Value = new (DIEValueAllocator) DIEInteger(0); + Die->addValue(Attribute, dwarf::DW_FORM_addr, Value); + } +} + /// addOpAddress - Add a dwarf op address data and value using the /// form given and an op of either DW_FORM_addr or DW_FORM_GNU_addr_index. /// |