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 | bec79b4a596ec17c456eecf22a74514f219ced30 (patch) | |
tree | bc7c3baa2a440f6cc6e72a1702d23e96101df6f1 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 9fcad09b1bd0e00d1799a52ff6b1b8e4527ea297 (diff) | |
download | llvm-bec79b4a596ec17c456eecf22a74514f219ced30.zip llvm-bec79b4a596ec17c456eecf22a74514f219ced30.tar.gz llvm-bec79b4a596ec17c456eecf22a74514f219ced30.tar.bz2 |
Add a MachineInstr::eraseFromParent convenience method.
llvm-svn: 27775
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 0351cc2..34a2a7d 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 { |