[llvm] 00570c2 - [bindings/go] Add RemoveFromParentAsInstruction

Ayke van Laethem via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 10:39:19 PST 2020


Author: Ayke van Laethem
Date: 2020-02-24T19:38:47+01:00
New Revision: 00570c2f18872ce0a1f68cc73e7e259ad67aa60d

URL: https://github.com/llvm/llvm-project/commit/00570c2f18872ce0a1f68cc73e7e259ad67aa60d
DIFF: https://github.com/llvm/llvm-project/commit/00570c2f18872ce0a1f68cc73e7e259ad67aa60d.diff

LOG: [bindings/go] Add RemoveFromParentAsInstruction

This allows removing instructions without erasing them. They can then be
added somewhere else in the IR using Builder.Insert().

Added: 
    

Modified: 
    llvm/bindings/go/llvm/ir.go

Removed: 
    


################################################################################
diff  --git a/llvm/bindings/go/llvm/ir.go b/llvm/bindings/go/llvm/ir.go
index 1a144eacb4d1..c1daf829608c 100644
--- a/llvm/bindings/go/llvm/ir.go
+++ b/llvm/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) }


        


More information about the llvm-commits mailing list