From 3509611238f10c17fbdb5e91e4917319d71c0b83 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 24 Feb 2020 19:38:47 +0100 Subject: [PATCH] [bindings/go] Add RemoveFromParentAsInstruction This allows removing instructions without erasing them. They can then be added somewhere else in the IR using Builder.Insert(). --- bindings/go/llvm/ir.go | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/go/llvm/ir.go b/bindings/go/llvm/ir.go index 1a144eacb4d..c1daf829608 100644 --- a/bindings/go/llvm/ir.go +++ b/bindings/go/llvm/ir.go @@ -1256,6 +1256,7 @@ func (bb BasicBlock) MoveAfter(pos BasicBlock) { C.LLVMMoveBasicBlockAfter(bb.C // Operations on instructions func (v Value) EraseFromParentAsInstruction() { C.LLVMInstructionEraseFromParent(v.C) } +func (v Value) RemoveFromParentAsInstruction() { C.LLVMInstructionRemoveFromParent(v.C) } func (v Value) InstructionParent() (bb BasicBlock) { bb.C = C.LLVMGetInstructionParent(v.C); return } func (v Value) InstructionDebugLoc() (md Metadata) { md.C = C.LLVMInstructionGetDebugLoc(v.C); return } func (v Value) InstructionSetDebugLoc(md Metadata) { C.LLVMInstructionSetDebugLoc(v.C, md.C) }