summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAyke van Laethem <aykevanlaethem@gmail.com>2019-06-08 22:15:38 +0000
committerAyke van Laethem <aykevanlaethem@gmail.com>2019-06-08 22:15:38 +0000
commitf675a60ca7a93f22e22dd4209504a9846dd04630 (patch)
tree3afaeff467ceab283efbd97c97efebcfc72ce958
parentda95e6c92b01018d929b33e3e3cb9a77844b536c (diff)
downloadbcm5719-llvm-f675a60ca7a93f22e22dd4209504a9846dd04630.tar.gz
bcm5719-llvm-f675a60ca7a93f22e22dd4209504a9846dd04630.zip
[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 llvm-svn: 362891
-rw-r--r--llvm/bindings/go/llvm/ir.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/bindings/go/llvm/ir.go b/llvm/bindings/go/llvm/ir.go
index 71f741421e8..3bfeac942b2 100644
--- a/llvm/bindings/go/llvm/ir.go
+++ b/llvm/bindings/go/llvm/ir.go
@@ -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
//-------------------------------------------------------------------------
OpenPOWER on IntegriCloud