diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-05 22:10:48 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-05 22:10:48 +0000 |
commit | 9466aa8cf38aa8e87fe3e2cd8005fc245d04f9b7 (patch) | |
tree | 5768fe118c2123446947adc1ae10128edc91a5de | |
parent | 329f854f217d72594a3ec5572eba6320f81a5efa (diff) |
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
-rw-r--r-- | Analysis/RValues.h | 22 |
1 files changed, 18 insertions, 4 deletions
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<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 @@ namespace nonlval { // Implement isa<T> support. static inline bool classof(const RValue* V) { - return V->getSubKind() == ConcreteIntKind; + return isa<NonLValue>(V) && V->getSubKind() == ConcreteIntKind; } }; |