Implement remove/eraseFromParent methods
llvm-svn: 16922
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index f54acf5..4ea5775 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/lib/VMCore/Instruction.cpp
@@ -72,6 +72,13 @@
if (PP && hasName()) PP->getSymbolTable().insert(this);
}
+void Instruction::removeFromParent() {
+ getParent()->getInstList().remove(this);
+}
+
+void Instruction::eraseFromParent() {
+ getParent()->getInstList().erase(this);
+}
const char *Instruction::getOpcodeName(unsigned OpCode) {
switch (OpCode) {