diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-17 21:35:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-17 21:35:41 +0000 |
commit | 48d7c069c76882475c23de153bda9483cd3c9bb4 (patch) | |
tree | 09cb903957be043d1c282088b850a48d02676fc7 /lib/CodeGen/MachineInstr.cpp | |
parent | 6b560918426182d2b46b899d609911d49f6739f7 (diff) |
Add a MachineInstr::eraseFromParent convenience method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27775 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 0351cc2783..34a2a7d628 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 { |