diff options
author | Torok Edwin <edwintorok@gmail.com> | 2011-10-06 12:13:20 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2011-10-06 12:13:20 +0000 |
commit | 4917ec9ec775d7bc7fbc3362b4c576c32b7617f4 (patch) | |
tree | 4fddaddd85044a6cfccd5e06a72974c89addd3e5 /lib/VMCore/Core.cpp | |
parent | 4f661ab0fb87f97c4a12912249c3c366df882102 (diff) |
add binding to read icmp predicate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Core.cpp')
-rw-r--r-- | lib/VMCore/Core.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index a21ec7a3f3..b8d2baf1e3 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -1552,6 +1552,15 @@ void LLVMInstructionEraseFromParent(LLVMValueRef Inst) { unwrap<Instruction>(Inst)->eraseFromParent(); } +LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst) { + if (ICmpInst *I = dyn_cast<ICmpInst>(unwrap(Inst))) + return (LLVMIntPredicate)I->getPredicate(); + if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst))) + if (CE->getOpcode() == Instruction::ICmp) + return (LLVMIntPredicate)CE->getPredicate(); + return (LLVMIntPredicate)0; +} + /*--.. Call and invoke instructions ........................................--*/ unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr) { |