From 3c89a4bf4b814c64c31e943cc3c5d07c940a9f4d Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 8 Jun 2019 22:21:37 +0000 Subject: [PATCH] [bindings/go] Add bindings to LLVMGet?CmpPredicate Add bindings so that predicates on comparisons (icmp/fcmp) can be inspected from IR. Note: I considered adding Value.ICmpPredicate() etc. instead but Value.IntPredicate() seemed easier to read and matches the name of the returned type. (This change was also pushed two commits ago but accidentally had the wrong title and description.) Revision: https://reviews.llvm.org/D53884 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362893 91177308-0d34-0410-b5e6-96231b3b80d8 --- bindings/go/llvm/ir.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bindings/go/llvm/ir.go b/bindings/go/llvm/ir.go index 71f741421e8..3bfeac942b2 100644 --- a/bindings/go/llvm/ir.go +++ b/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 //------------------------------------------------------------------------- -- 2.50.1