Add some convenience methods.
authorChris Lattner <sabre@nondot.org>
Mon, 17 Apr 2006 21:35:08 +0000 (21:35 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 17 Apr 2006 21:35:08 +0000 (21:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27774 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h

index b84388597af4a893c8c21ae522f21c22e96e33b4..05facbe5e056d5252441fa849bb73b3a9f5d6234 100644 (file)
@@ -499,6 +499,16 @@ public:
   /// clone - Create a copy of 'this' instruction that is identical in
   /// all ways except the the instruction has no parent, prev, or next.
   MachineInstr* clone() const;
+  
+  /// removeFromParent - This method unlinks 'this' from the containing basic
+  /// block, and returns it, but does not delete it.
+  MachineInstr *removeFromParent();
+  
+  /// eraseFromParent - This method unlinks 'this' from the containing basic
+  /// block and deletes it.
+  void eraseFromParent() {
+    delete removeFromParent();
+  }
 
   //
   // Debugging support