[cfe-commits] r46771 - /cfe/trunk/Analysis/RValues.h

Ted Kremenek kremenek at apple.com
Tue Feb 5 14:10:48 PST 2008


Author: kremenek
Date: Tue Feb  5 16:10:48 2008
New Revision: 46771

URL: http://llvm.org/viewvc/llvm-project?rev=46771&view=rev
Log:
Added new "NonLValue" class: SymIntConstraintVal. This class represents a binary
contraint between a symbol and an integer constant.

Modified:
    cfe/trunk/Analysis/RValues.h

Modified: cfe/trunk/Analysis/RValues.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/RValues.h?rev=46771&r1=46770&r2=46771&view=diff

==============================================================================
--- cfe/trunk/Analysis/RValues.h (original)
+++ cfe/trunk/Analysis/RValues.h Tue Feb  5 16:10:48 2008
@@ -301,7 +301,7 @@
 namespace nonlval {
   
   enum Kind { SymbolValKind,
-              SymIntConstraintKind,
+              SymIntConstraintValKind,
               ConcreteIntKind,
               NumKind };
 
@@ -316,8 +316,22 @@
     }
     
     static inline bool classof(const RValue* V) {
-      return V->getSubKind() == SymbolValKind;
-    }  
+      return isa<NonLValue>(V) && V->getSubKind() == SymbolValKind;
+    }
+  };
+  
+  class SymIntConstraintVal : public NonLValue {    
+  public:
+    SymIntConstraintVal(const SymIntConstraint& C)
+    : NonLValue(SymIntConstraintValKind, reinterpret_cast<const void*>(&C)) {}
+
+    const SymIntConstraint& getConstraint() const {
+      return *reinterpret_cast<SymIntConstraint*>(getRawPtr());
+    }
+    
+    static inline bool classof(const RValue* V) {
+      return isa<NonLValue>(V) && V->getSubKind() == SymIntConstraintValKind;
+    }    
   };
 
   class ConcreteInt : public NonLValue {
@@ -387,7 +401,7 @@
     
     // Implement isa<T> support.
     static inline bool classof(const RValue* V) {
-      return V->getSubKind() == ConcreteIntKind;
+      return isa<NonLValue>(V) && V->getSubKind() == ConcreteIntKind;
     }
   };
   





More information about the cfe-commits mailing list