From bec79b4a596ec17c456eecf22a74514f219ced30 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 17 Apr 2006 21:35:41 +0000 Subject: Add a MachineInstr::eraseFromParent convenience method. llvm-svn: 27775 --- llvm/lib/CodeGen/MachineInstr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/CodeGen/MachineInstr.cpp') diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 0351cc2783e..34a2a7d6284 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -100,6 +100,15 @@ MachineInstr* MachineInstr::clone() const { return new MachineInstr(*this); } +/// removeFromParent - This method unlinks 'this' from the containing basic +/// block, and returns it, but does not delete it. +MachineInstr *MachineInstr::removeFromParent() { + assert(getParent() && "Not embedded in a basic block!"); + getParent()->remove(this); + return this; +} + + /// OperandComplete - Return true if it's illegal to add a new operand /// bool MachineInstr::OperandsComplete() const { -- cgit v1.2.3