diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-11-22 23:43:29 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-11-22 23:43:29 +0000 |
| commit | a717ce7c70370edfd67a74f9e662659ad3814dc9 (patch) | |
| tree | 9a4d046324c41d002a7643c9efa3597f9079782d | |
| parent | 176d048901034698dc52707a94506c8cf63ee059 (diff) | |
| download | bcm5719-llvm-a717ce7c70370edfd67a74f9e662659ad3814dc9.tar.gz bcm5719-llvm-a717ce7c70370edfd67a74f9e662659ad3814dc9.zip | |
add some static icmpinst predicates.
llvm-svn: 44283
| -rw-r--r-- | llvm/include/llvm/Instructions.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/llvm/include/llvm/Instructions.h b/llvm/include/llvm/Instructions.h index a4fcb820f43..ba132cfd58f 100644 --- a/llvm/include/llvm/Instructions.h +++ b/llvm/include/llvm/Instructions.h @@ -640,24 +640,34 @@ public: /// @brief Return the signed version of the predicate. static Predicate getSignedPredicate(Predicate pred); - /// This also tests for commutativity. If isEquality() returns true then - /// the predicate is also commutative. - /// @returns true if the predicate of this instruction is EQ or NE. - /// @brief Determine if this is an equality predicate. + /// isEquality - Return true if this predicate is either EQ or NE. This also + /// tests for commutativity. + static bool isEquality(Predicate P) { + return P == ICMP_EQ || P == ICMP_NE; + } + + /// isEquality - Return true if this predicate is either EQ or NE. This also + /// tests for commutativity. bool isEquality() const { - return SubclassData == ICMP_EQ || SubclassData == ICMP_NE; + return isEquality(getPredicate()); } /// @returns true if the predicate of this ICmpInst is commutative /// @brief Determine if this relation is commutative. bool isCommutative() const { return isEquality(); } - /// @returns true if the predicate is relational (not EQ or NE). - /// @brief Determine if this a relational predicate. + /// isRelational - Return true if the predicate is relational (not EQ or NE). + /// bool isRelational() const { return !isEquality(); } + /// isRelational - Return true if the predicate is relational (not EQ or NE). + /// + static bool isRelational(Predicate P) { + return !isEquality(P); + } + /// @returns true if the predicate of this ICmpInst is signed, false otherwise /// @brief Determine if this instruction's predicate is signed. bool isSignedPredicate() const { return isSignedPredicate(getPredicate()); } |

