[PATCH] D75188: [NFC][DebugInfo] Refactor address advancing operations to share code

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 09:00:29 PST 2020


probinson added a comment.

One final question and reiterate LGTM.



================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:917
         {
-          uint8_t AdjustOpcode = 255 - Prologue.OpcodeBase;
-          uint64_t AddrOffset =
-              (AdjustOpcode / Prologue.LineRange) * Prologue.MinInstLength;
-          State.Row.Address.Address += AddrOffset;
+          uint64_t AddrOffset = State.advanceAddrForOpcode(255).AddrDelta;
           if (OS)
----------------
jhenderson wrote:
> probinson wrote:
> > It seems like there ought to be a symbol for opcode 255, but you inherited the code so I won't insist.
> I can add that in a separate change if you'd like, although I'm not entirely sure what I'd label it as, since the DWARF spec (as quoted by the comment above) simply calls it the "special opcode 255".
Not necessary.
We do assert that maximum_operations_per_instruction is 1, right? The advance operations are not factoring that in, but if it's always 1 then the simplified operations are correct.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75188/new/

https://reviews.llvm.org/D75188





More information about the llvm-commits mailing list