Skip to content

Commit 00570c2

Browse files
committed
[bindings/go] Add RemoveFromParentAsInstruction
This allows removing instructions without erasing them. They can then be added somewhere else in the IR using Builder.Insert().
1 parent 5b2046c commit 00570c2

File tree

1 file changed

+1
-0
lines changed
  • llvm/bindings/go/llvm

1 file changed

+1
-0
lines changed

llvm/bindings/go/llvm/ir.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,7 @@ func (bb BasicBlock) MoveAfter(pos BasicBlock) { C.LLVMMoveBasicBlockAfter(bb.C
12561256

12571257
// Operations on instructions
12581258
func (v Value) EraseFromParentAsInstruction() { C.LLVMInstructionEraseFromParent(v.C) }
1259+
func (v Value) RemoveFromParentAsInstruction() { C.LLVMInstructionRemoveFromParent(v.C) }
12591260
func (v Value) InstructionParent() (bb BasicBlock) { bb.C = C.LLVMGetInstructionParent(v.C); return }
12601261
func (v Value) InstructionDebugLoc() (md Metadata) { md.C = C.LLVMInstructionGetDebugLoc(v.C); return }
12611262
func (v Value) InstructionSetDebugLoc(md Metadata) { C.LLVMInstructionSetDebugLoc(v.C, md.C) }

0 commit comments

Comments
 (0)