Add C api for Instruction->eraseFromParent().
authorDevang Patel <dpatel@apple.com>
Mon, 3 Oct 2011 20:59:18 +0000 (20:59 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 3 Oct 2011 20:59:18 +0000 (20:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141023 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/Core.h
lib/VMCore/Core.cpp

index baea5ab640497bcc2f6dc4f2981d78b76b288355..84ddfbcf89000ca56a4ffbec72b1c4a0ce09a823 100644 (file)
@@ -776,6 +776,7 @@ LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB);
 LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst);
 LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst);
 LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst);
+void LLVMInstructionEraseFromParent(LLVMValueRef Inst);
 
 /* Operations on call sites */
 void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
index 42896ddbad62852bb0b4355cda2c73b454eceaec..e2b659b6a2b78c802798c4f4258dc377abe354fa 100644 (file)
@@ -1508,6 +1508,10 @@ LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst) {
   return wrap(--I);
 }
 
+void LLVMInstructionEraseFromParent(LLVMValueRef Inst) {
+  unwrap<Instruction>(Inst)->eraseFromParent();
+}
+
 /*--.. Call and invoke instructions ........................................--*/
 
 unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr) {