CompareInstruction class (Seth Warn)

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@76 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2009-03-25 12:14:28 +00:00
commit f3989aa240
4 changed files with 26 additions and 0 deletions

View file

@ -1420,6 +1420,13 @@ class SwitchInstruction(Instruction):
_core.LLVMAddCase(self.ptr, const.ptr, bblk.ptr)
class CompareInstruction(Instruction):
@property
def predicate(self):
return _core.LLVMCmpInstGetPredicate(self.ptr)
#===----------------------------------------------------------------------===
# Basic block
#===----------------------------------------------------------------------===
@ -1469,6 +1476,8 @@ __class_for_valueid = {
VALUE_INSTRUCTION + OPCODE_CALL : CallOrInvokeInstruction,
VALUE_INSTRUCTION + OPCODE_INVOKE : CallOrInvokeInstruction,
VALUE_INSTRUCTION + OPCODE_SWITCH : SwitchInstruction,
VALUE_INSTRUCTION + OPCODE_ICMP : CompareInstruction,
VALUE_INSTRUCTION + OPCODE_FCMP : CompareInstruction
}
def _make_value(ptr):