[llvm] r362891 - [bindings/go] Add Go bindings for CalledValue
Ayke van Laethem via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 8 15:15:39 PDT 2019
Author: aykevl
Date: Sat Jun 8 15:15:38 2019
New Revision: 362891
URL: http://llvm.org/viewvc/llvm-project?rev=362891&view=rev
Log:
[bindings/go] Add Go bindings for CalledValue
This is very useful for inspecting generated IR, there appears to be no
other way to get the called function from a CallInst.
Differential Revision: https://reviews.llvm.org/D52972
Modified:
llvm/trunk/bindings/go/llvm/ir.go
Modified: llvm/trunk/bindings/go/llvm/ir.go
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/ir.go?rev=362891&r1=362890&r2=362891&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/ir.go (original)
+++ llvm/trunk/bindings/go/llvm/ir.go Sat Jun 8 15:15:38 2019
@@ -1275,6 +1275,10 @@ func (v Value) Indices() []uint32 {
return indices
}
+// Operations on comparisons
+func (v Value) IntPredicate() IntPredicate { return IntPredicate(C.LLVMGetICmpPredicate(v.C)) }
+func (v Value) FloatPredicate() FloatPredicate { return FloatPredicate(C.LLVMGetFCmpPredicate(v.C)) }
+
//-------------------------------------------------------------------------
// llvm.Builder
//-------------------------------------------------------------------------
More information about the llvm-commits
mailing list