[llvm] [MIR][MachineInstr] Update MachineInstr::eraseFromParent() to return an iterator (PR #179787)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 10:08:46 PST 2026


================
@@ -1329,7 +1330,10 @@ class MachineInstr
   /// If this instruction is the header of a bundle, the whole bundle is erased.
   /// This function can not be used for instructions inside a bundle, use
   /// eraseFromBundle() to erase individual bundled instructions.
-  LLVM_ABI void eraseFromParent();
+  /// \returns the iterator following the erased instruction. If this is the
+  /// header of a bundle it returns the iterator following the erased bundle
+  /// iterator.
+  LLVM_ABI MachineInstrBundleIterator<MachineInstr> eraseFromParent();
----------------
vporpo wrote:

MachineBasicBlock::iterator is not available here because MachineInstr.h is included by MachineBasicBlock.h, not the other way around.

https://github.com/llvm/llvm-project/pull/179787


More information about the llvm-commits mailing list