[PATCH] D52694: [bindings/go] Add EraseFromParent

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 29 09:12:22 PDT 2018


aykevl created this revision.
aykevl added reviewers: pcc, whitequark.

After using ReplaceAllUsesWith on an instruction, it may be necessary to erase it even though it is dead.


Repository:
  rL LLVM

https://reviews.llvm.org/D52694

Files:
  bindings/go/llvm/ir.go


Index: bindings/go/llvm/ir.go
===================================================================
--- bindings/go/llvm/ir.go
+++ bindings/go/llvm/ir.go
@@ -1210,6 +1210,7 @@
 func (bb BasicBlock) MoveAfter(pos BasicBlock)  { C.LLVMMoveBasicBlockAfter(bb.C, pos.C) }
 
 // Operations on instructions
+func (v Value) EraseFromParentAsInstruction()      { C.LLVMInstructionEraseFromParent(v.C) }
 func (v Value) InstructionParent() (bb BasicBlock) { bb.C = C.LLVMGetInstructionParent(v.C); return }
 func (bb BasicBlock) FirstInstruction() (v Value)  { v.C = C.LLVMGetFirstInstruction(bb.C); return }
 func (bb BasicBlock) LastInstruction() (v Value)   { v.C = C.LLVMGetLastInstruction(bb.C); return }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52694.167610.patch
Type: text/x-patch
Size: 699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180929/c2268a34/attachment.bin>


More information about the llvm-commits mailing list