Author: kremenek
Date: Thu Jul 17 18:24:36 2008
New Revision: 53744

URL: http://llvm.org/viewvc/llvm-project?rev=53744&view=rev
Log:
Provide static methods in BinaryOperator to determine if an opcode is an 
equality opcode, a relational opcode, or a logical opcode.

Modified:
    cfe/trunk/include/clang/AST/Expr.h

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=53744&r1=53743&r2=53744&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Thu Jul 17 18:24:36 2008
@@ -937,9 +937,16 @@
   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; }


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to