diff options
author | Eric Christopher <echristo@gmail.com> | 2013-11-16 00:18:40 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-11-16 00:18:40 +0000 |
commit | d0b82aea8c45e3289cdabced2bba5dc66e921847 (patch) | |
tree | 80ab49c912c13205a10a97703c6b8e5ca597ad7a /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 4762b23e6ce4590a0a3ba648179332b02bd98561 (diff) | |
download | bcm5719-llvm-d0b82aea8c45e3289cdabced2bba5dc66e921847.tar.gz bcm5719-llvm-d0b82aea8c45e3289cdabced2bba5dc66e921847.zip |
For dwarf4 use the correct form for referencing debug_loc locations,
and update test cases accordingly.
This doesn't affect the output dumped using llvm-dwarfdump, but
readelf does now dump the debug_loc section.
llvm-svn: 194898
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 2adbeb9f6bf..c85d7b21c4b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1772,7 +1772,9 @@ DIE *CompileUnit::constructVariableDIE(DbgVariable &DV, bool isScopeAbstract) { unsigned Offset = DV.getDotDebugLocOffset(); if (Offset != ~0U) { - addLabel(VariableDie, dwarf::DW_AT_location, dwarf::DW_FORM_data4, + addLabel(VariableDie, dwarf::DW_AT_location, + DD->getDwarfVersion() >= 4 ? dwarf::DW_FORM_sec_offset + : dwarf::DW_FORM_data4, Asm->GetTempSymbol("debug_loc", Offset)); DV.setDIE(VariableDie); return VariableDie; |