summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEkaterina Romanova <katya_romanova@playstation.sony.com>2016-12-16 05:10:11 +0000
committerEkaterina Romanova <katya_romanova@playstation.sony.com>2016-12-16 05:10:11 +0000
commit25da8a9b53bb7789e3b91edecb026b9968165f5f (patch)
tree40ae597122fb45cc4ca338d7b244e108ad14be0d /llvm/lib
parent73fd4936181557019d4662ad8ab80d41dd9f30d9 (diff)
downloadbcm5719-llvm-25da8a9b53bb7789e3b91edecb026b9968165f5f.tar.gz
bcm5719-llvm-25da8a9b53bb7789e3b91edecb026b9968165f5f.zip
Update .debug_line section version information to match DWARF version.
One more attempt to re-commit the patch r285355, which I had to revert in r285362, because some tests were failing (the reason is because the size of the line_table varied depending on the full file name). In the past the compiler always emitted .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler. This patch changes version information of .debug_line to exactly match the DWARF version. For .debug_line version 4, a new field maximum_operations_per_instruction is emitted. Differential Revision: https://reviews.llvm.org/D16697 llvm-svn: 289925
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index a7551a3283a..5e4230a81f0 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -263,8 +263,8 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
emitAbsValue(*MCOS,
MakeStartMinusEndExpr(*MCOS, *LineStartSym, *LineEndSym, 4), 4);
- // Next 2 bytes is the Version, which is Dwarf 2.
- MCOS->EmitIntValue(2, 2);
+ // Next 2 bytes is the Version.
+ MCOS->EmitIntValue(context.getDwarfVersion(), 2);
// Create a symbol for the end of the prologue (to be set when we get there).
MCSymbol *ProEndSym = context.createTempSymbol(); // Lprologue_end
@@ -279,6 +279,11 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
// Parameters of the state machine, are next.
MCOS->EmitIntValue(context.getAsmInfo()->getMinInstAlignment(), 1);
+ // maximum_operations_per_instruction
+ // For non-VLIW architectures this field is always 1.
+ // FIXME: VLIW architectures need to update this field accordingly.
+ if (context.getDwarfVersion() >= 4)
+ MCOS->EmitIntValue(1, 1);
MCOS->EmitIntValue(DWARF2_LINE_DEFAULT_IS_STMT, 1);
MCOS->EmitIntValue(Params.DWARF2LineBase, 1);
MCOS->EmitIntValue(Params.DWARF2LineRange, 1);
OpenPOWER on IntegriCloud