[PATCH] D150577: [CodeGen] Fix for MachineBasicBlock::rfindDebugLoc(instr_rend())

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 07:50:27 PDT 2023


bjope created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
bjope requested review of this revision.
Herald added a project: LLVM.

- Add some simple unittests for the findDebugLoc, rfindDebugLoc, findPrevDebugLoc and rfindPrevDebugLoc helpers in MachineBasicBlock.

- Make sure we do not crash in rfindDebugLoc when starting at instr_rend(). Solution is to see it as we start one MI before the first MI, so we can start searching forward at instr_begin() instead.

- Clean up code comments and code formatting related to the functions mentioned above.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150577

Files:
  llvm/include/llvm/CodeGen/MachineBasicBlock.h
  llvm/lib/CodeGen/MachineBasicBlock.cpp
  llvm/unittests/CodeGen/CMakeLists.txt
  llvm/unittests/CodeGen/MachineBasicBlockTest.cpp
  llvm/utils/gn/secondary/llvm/unittests/CodeGen/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150577.522191.patch
Type: text/x-patch
Size: 8741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230515/2d15316c/attachment.bin>


More information about the llvm-commits mailing list