From 0e6a24d92ab4661bb39f838ac390ccb17f649cb5 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 3 Oct 2011 20:59:18 +0000 Subject: [PATCH] Add C api for Instruction->eraseFromParent(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141023 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm-c/Core.h | 1 + lib/VMCore/Core.cpp | 4 ++++ 2 files changed, 5 insertions(+) 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) { -- 2.34.1