diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index baea5ab6404..84ddfbcf890 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -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); diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 42896ddbad6..e2b659b6a2b 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -1508,6 +1508,10 @@ LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst) { return wrap(--I); } +void LLVMInstructionEraseFromParent(LLVMValueRef Inst) { + unwrap(Inst)->eraseFromParent(); +} + /*--.. Call and invoke instructions ........................................--*/ unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr) {