[PATCH] D56135: Allow reverse iterators for `MachineBasicBlock::findDebugLoc` and `MachineBasicBlock::findPrevDebugLoc`

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 2 08:53:01 PST 2019


fhahn added a comment.

Are there any instances in the current codebase where this would be useful?



================
Comment at: lib/CodeGen/MachineBasicBlock.cpp:1293
+  MBBI = skipDebugInstructionsBackward(MBBI, instr_rbegin());
+  if (!MBBI->isDebugInstr()) return MBBI->getDebugLoc();
+  return {};
----------------
nit: return on new line.


================
Comment at: lib/CodeGen/MachineBasicBlock.cpp:1308
+  // Skip debug declarations, we don't want a DebugLoc from them.
+  MBBI = skipDebugInstructionsForward(std::prev(MBBI), instr_rend());
+  if (MBBI != instr_rend())
----------------
Should this be std::next here?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56135





More information about the llvm-commits mailing list