diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-22 21:39:21 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-22 21:39:21 +0000 |
commit | a548846b471f7ca05ec6038c7d9d3b4d0de777cc (patch) | |
tree | c1058534cfcb155a4145715be9d2e41f2438f928 /include/clang | |
parent | 0fe33bc94a822e315585e5cde1964d3c3b9052f9 (diff) |
Added lval type (and tracking) for StringLiterals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Analysis/PathSensitive/RValues.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/include/clang/Analysis/PathSensitive/RValues.h b/include/clang/Analysis/PathSensitive/RValues.h index 45a5452ffc..8a53588564 100644 --- a/include/clang/Analysis/PathSensitive/RValues.h +++ b/include/clang/Analysis/PathSensitive/RValues.h @@ -128,7 +128,7 @@ public: static NonLVal MakeVal(BasicValueFactory& BasicVals, uint64_t X, QualType T); static NonLVal MakeVal(BasicValueFactory& BasicVals, IntegerLiteral* I); - + static NonLVal MakeIntTruthVal(BasicValueFactory& BasicVals, bool b); // Implement isa<T> support. @@ -151,6 +151,8 @@ public: static LVal MakeVal(AddrLabelExpr* E); + static LVal MakeVal(StringLiteral* S); + // Implement isa<T> support. static inline bool classof(const RVal* V) { return V->getBaseKind() == LValKind; @@ -274,7 +276,7 @@ public: namespace lval { enum Kind { SymbolValKind, GotoLabelKind, DeclValKind, FuncValKind, - ConcreteIntKind }; + ConcreteIntKind, StringLiteralValKind }; class SymbolVal : public LVal { public: @@ -391,6 +393,24 @@ public: } }; +class StringLiteralVal : public LVal { +public: + StringLiteralVal(StringLiteral* L) : LVal(StringLiteralValKind, L) {} + + StringLiteral* getLiteral() const { return (StringLiteral*) Data; } + + // Implement isa<T> support. + static inline bool classof(const RVal* V) { + return V->getBaseKind() == LValKind && + V->getSubKind() == StringLiteralValKind; + } + + static inline bool classof(const LVal* V) { + return V->getSubKind() == StringLiteralValKind; + } +}; + + } // end clang::lval namespace } // end clang namespace |