From: Ted Kremenek Date: Tue, 5 Feb 2008 22:10:48 +0000 (+0000) Subject: Added new "NonLValue" class: SymIntConstraintVal. This class represents a binary X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9466aa8cf38aa8e87fe3e2cd8005fc245d04f9b7;p=clang Added new "NonLValue" class: SymIntConstraintVal. This class represents a binary contraint between a symbol and an integer constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46771 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Analysis/RValues.h b/Analysis/RValues.h index 05ac663dd5..ef7c82ecdd 100644 --- a/Analysis/RValues.h +++ b/Analysis/RValues.h @@ -301,7 +301,7 @@ public: namespace nonlval { enum Kind { SymbolValKind, - SymIntConstraintKind, + SymIntConstraintValKind, ConcreteIntKind, NumKind }; @@ -316,8 +316,22 @@ namespace nonlval { } static inline bool classof(const RValue* V) { - return V->getSubKind() == SymbolValKind; - } + return isa(V) && V->getSubKind() == SymbolValKind; + } + }; + + class SymIntConstraintVal : public NonLValue { + public: + SymIntConstraintVal(const SymIntConstraint& C) + : NonLValue(SymIntConstraintValKind, reinterpret_cast(&C)) {} + + const SymIntConstraint& getConstraint() const { + return *reinterpret_cast(getRawPtr()); + } + + static inline bool classof(const RValue* V) { + return isa(V) && V->getSubKind() == SymIntConstraintValKind; + } }; class ConcreteInt : public NonLValue { @@ -387,7 +401,7 @@ namespace nonlval { // Implement isa support. static inline bool classof(const RValue* V) { - return V->getSubKind() == ConcreteIntKind; + return isa(V) && V->getSubKind() == ConcreteIntKind; } };