summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-07-17 23:24:36 +0000
committerTed Kremenek <kremenek@apple.com>2008-07-17 23:24:36 +0000
commit2fe3afca04b51af9063ddec285196db58c1b52d0 (patch)
tree7d6ce393a12ede962b4e89794a1cbb6a1289623c
parent9c32a1ecf5dfcd7c26b89550d813602018bbfa03 (diff)
downloadbcm5719-llvm-2fe3afca04b51af9063ddec285196db58c1b52d0.tar.gz
bcm5719-llvm-2fe3afca04b51af9063ddec285196db58c1b52d0.zip
Provide static methods in BinaryOperator to determine if an opcode is an equality opcode, a relational opcode, or a logical opcode.
llvm-svn: 53744
-rw-r--r--clang/include/clang/AST/Expr.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index afe1c4bb367..51b8588d5fd 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -937,9 +937,16 @@ public:
bool isAdditiveOp() const { return Opc == Add || Opc == Sub; }
bool isShiftOp() const { return Opc == Shl || Opc == Shr; }
bool isBitwiseOp() const { return Opc >= And && Opc <= Or; }
- bool isRelationalOp() const { return Opc >= LT && Opc <= GE; }
- bool isEqualityOp() const { return Opc == EQ || Opc == NE; }
- bool isLogicalOp() const { return Opc == LAnd || Opc == LOr; }
+
+ static bool isRelationalOp(Opcode Opc) { return Opc >= LT && Opc <= GE; }
+ bool isRelationalOp() const { return isRelationalOp(Opc); }
+
+ static bool isEqualityOp(Opcode Opc) { return Opc == EQ || Opc == NE; }
+ bool isEqualityOp() const { return isEqualityOp(Opc); }
+
+ static bool isLogicalOp(Opcode Opc) { return Opc == LAnd || Opc == LOr; }
+ bool isLogicalOp() const { return isLogicalOp(Opc); }
+
bool isAssignmentOp() const { return Opc >= Assign && Opc <= OrAssign; }
bool isCompoundAssignmentOp() const { return Opc > Assign && Opc <= OrAssign;}
bool isShiftAssignOp() const { return Opc == ShlAssign || Opc == ShrAssign; }
OpenPOWER on IntegriCloud