From: Frederic Riss Date: Sun, 15 Mar 2015 20:45:39 +0000 (+0000) Subject: [MCDwarf] Do not emit useless line table opcode. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=02c39fa2778bf512f2721373c286fb9e9e67918d;p=oota-llvm.git [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232332 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index 5d969140379..78b4e6b4010 100644 --- a/lib/MC/MCDwarf.cpp +++ b/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); }