From: Chris Lattner Date: Mon, 17 Apr 2006 21:35:41 +0000 (+0000) Subject: Add a MachineInstr::eraseFromParent convenience method. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=48d7c069c76882475c23de153bda9483cd3c9bb4;p=oota-llvm.git Add a MachineInstr::eraseFromParent convenience method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27775 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 0351cc2783e..34a2a7d6284 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/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 {