diff options
author | Frederic Riss <friss@apple.com> | 2015-03-15 20:45:39 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2015-03-15 20:45:39 +0000 |
commit | ceb1836d3a148572fab765de54b58495eca749e3 (patch) | |
tree | 2a488f75ca815faead7744118af70137527e4141 /llvm/lib/MC/MCDwarf.cpp | |
parent | e2c6a1b96db1edb5d472d1e4365e0d517c8c9cf4 (diff) | |
download | bcm5719-llvm-ceb1836d3a148572fab765de54b58495eca749e3.tar.gz bcm5719-llvm-ceb1836d3a148572fab765de54b58495eca749e3.zip |
[MCDwarf] Do not emit useless line table opcode.
No need to emit a DW_LNS_advance_pc with a 0 increment. Found out while
comparing dsymutil's and LLVM's line table encoding. Not a correctenss
fix, just a small encoding size optimization.
I'm not sure how to generate a sequence that triggers this, and moreover
llvm-dwardump doesn't dump the line table program, thus the effort
involved in creating a testcase for this trivial patch seemed out of
proportion.
llvm-svn: 232332
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r-- | llvm/lib/MC/MCDwarf.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index 5d969140379..78b4e6b4010 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -446,7 +446,7 @@ void MCDwarfLineAddr::Encode(MCContext &Context, int64_t LineDelta, if (LineDelta == INT64_MAX) { if (AddrDelta == MAX_SPECIAL_ADDR_DELTA) OS << char(dwarf::DW_LNS_const_add_pc); - else { + else if (AddrDelta) { OS << char(dwarf::DW_LNS_advance_pc); encodeULEB128(AddrDelta, OS); } |