[PATCH] D74819: [DebugInfo] Report unsupported maximum_operations_per_instruction values

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 07:40:47 PST 2020


probinson added a comment.

Thanks for simplifying the API.  One more bit of code tidying and I think I will be happy.



================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:581
+                                                   uint64_t OpcodeOffset) {
+  StringRef OpcodeName = getOpcodeName(Opcode, LineTable->Prologue.OpcodeBase);
+  // For versions less than 4, the MaxOpsPerInst member is set to 0, as the
----------------
Sink this under the `if` as you don't need the name unless you're reporting the warning.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:595
+        LineTable->Prologue.MaxOpsPerInst));
+  ReportAdvanceAddrProblem = false;
   uint64_t AddrOffset = OperationAdvance * LineTable->Prologue.MinInstLength;
----------------
After sinking the getOpcodeName call, you have a block under the `if` instead of just a single statement, in which case you might as well move `ReportAdvanceAddrProblem = false` into that block as well.
These moves help distinguish the error-reporting stuff from the functional stuff as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74819





More information about the llvm-commits mailing list