diff options
author | Eric Christopher <echristo@gmail.com> | 2013-11-21 23:46:41 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-11-21 23:46:41 +0000 |
commit | 33ff697cb1037a1e9361a0acee8f0faaae990bd3 (patch) | |
tree | 40ee3cc41a76761381d55bc6bb75d6ac2dfd5d53 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | |
parent | fd133b300c1267ef2e78db1e918391531c8ef012 (diff) | |
download | bcm5719-llvm-33ff697cb1037a1e9361a0acee8f0faaae990bd3.tar.gz bcm5719-llvm-33ff697cb1037a1e9361a0acee8f0faaae990bd3.zip |
In Dwarf 3 (and Dwarf 2) attributes whose value are offsets into a
section use the form DW_FORM_data4 whilst in Dwarf 4 and later they
use the form DW_FORM_sec_offset.
This patch updates the places where such attributes are generated to
use the appropriate form depending on the Dwarf version. The DIE entries
affected have the following tags:
DW_AT_stmt_list, DW_AT_ranges, DW_AT_location, DW_AT_GNU_pubnames,
DW_AT_GNU_pubtypes, DW_AT_GNU_addr_base, DW_AT_GNU_ranges_base
It also adds a hidden command line option "--dwarf-version=<uint>"
to llc which allows the version of Dwarf to be generated to override
what is specified in the metadata; this makes it possible to update
existing tests to check the debugging information generated for both
Dwarf 4 (the default) and Dwarf 3 using the same metadata.
Patch (slightly modified) by Keith Walker!
llvm-svn: 195391
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 23d3afc0242..0821a9a2b98 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -212,6 +212,14 @@ public: void addLabel(DIEBlock *Die, dwarf::Form Form, const MCSymbol *Label); + /// addSectionLabel - Add a Dwarf section label attribute data and value. + /// + void addSectionLabel(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Label); + + /// addSectionOffset - Add an offset into a section attribute data and value. + /// + void addSectionOffset(DIE *Die, dwarf::Attribute Attribute, uint64_t Integer); + /// addLabelAddress - Add a dwarf label attribute data and value using /// either DW_FORM_addr or DW_FORM_GNU_addr_index. void addLabelAddress(DIE *Die, dwarf::Attribute Attribute, MCSymbol *Label); @@ -220,9 +228,9 @@ public: /// form given and an op of either DW_FORM_addr or DW_FORM_GNU_addr_index. void addOpAddress(DIEBlock *Die, const MCSymbol *Label); - /// addDelta - Add a label delta attribute data and value. - void addDelta(DIE *Die, dwarf::Attribute Attribute, dwarf::Form Form, - const MCSymbol *Hi, const MCSymbol *Lo); + /// addSectionDelta - Add a label delta attribute data and value. + void addSectionDelta(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Hi, + const MCSymbol *Lo); /// addDIEEntry - Add a DIE attribute data and value. void addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIE *Entry); |