diff options
author | Ayke van Laethem <aykevanlaethem@gmail.com> | 2019-06-08 22:21:37 +0000 |
---|---|---|
committer | Ayke van Laethem <aykevanlaethem@gmail.com> | 2019-06-08 22:21:37 +0000 |
commit | 548db794a43c99a47a56bc7a873dc7991966967a (patch) | |
tree | 3afaeff467ceab283efbd97c97efebcfc72ce958 /llvm/bindings/go | |
parent | df9d6cf6a2f415508eed50ea84145218d714172b (diff) | |
download | bcm5719-llvm-548db794a43c99a47a56bc7a873dc7991966967a.tar.gz bcm5719-llvm-548db794a43c99a47a56bc7a873dc7991966967a.zip |
[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
llvm-svn: 362893
Diffstat (limited to 'llvm/bindings/go')
-rw-r--r-- | llvm/bindings/go/llvm/ir.go | 4 |
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 //------------------------------------------------------------------------- |