diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-04-11 00:11:10 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-04-11 00:11:10 +0000 |
commit | 1670e403c48f3af4fceff3f6773a0e1cfc6c4eb3 (patch) | |
tree | 3b1044513e874e7285fa3b8a874122286b97066b /include/clang/Analysis/ProgramPoint.h | |
parent | c2112181b96349eb595dc5e8b7073b81ecdec0db (diff) |
Implement analyzer support for OSCompareAndSwap. This required pushing "tagged"
ProgramPoints all the way through to GRCoreEngine.
NSString.m now fails with RegionStoreManager because of the void** cast.
Disabling use of region store for that test for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68845 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/ProgramPoint.h')
-rw-r--r-- | include/clang/Analysis/ProgramPoint.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index 7c73a1f25d..1587371961 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -57,9 +57,9 @@ protected: : Data(reinterpret_cast<uintptr_t>(P1) | TwoPointers, reinterpret_cast<uintptr_t>(P2)), Tag(tag) {} - ProgramPoint(const void* P1, const void* P2, bool) + ProgramPoint(const void* P1, const void* P2, bool, const void *tag = 0) : Data(reinterpret_cast<uintptr_t>(P1) | Custom, - reinterpret_cast<uintptr_t>(P2)), Tag(0) {} + reinterpret_cast<uintptr_t>(P2)), Tag(tag) {} protected: void* getData1NoMask() const { @@ -173,10 +173,13 @@ protected: PostStmt(const Stmt* S, Kind k,const void *tag = 0) : ProgramPoint(S, k, tag) {} - PostStmt(const Stmt* S, const void* data) : ProgramPoint(S, data, true) {} + PostStmt(const Stmt* S, const void* data, bool, const void *tag =0) + : ProgramPoint(S, data, true, tag) {} public: - PostStmt(const Stmt* S) : ProgramPoint(S, PostStmtKind) {} + PostStmt(const Stmt* S, const void *tag = 0) + : ProgramPoint(S, PostStmtKind, tag) {} + Stmt* getStmt() const { return (Stmt*) getData1(); } @@ -200,7 +203,7 @@ class PostStmtCustom : public PostStmt { public: PostStmtCustom(const Stmt* S, const std::pair<const void*, const void*>* TaggedData) - : PostStmt(S, TaggedData) { + : PostStmt(S, TaggedData, true) { assert(getKind() == PostStmtCustomKind); } @@ -219,8 +222,8 @@ public: class PostOutOfBoundsCheckFailed : public PostStmt { public: - PostOutOfBoundsCheckFailed(const Stmt* S) - : PostStmt(S, PostOutOfBoundsCheckFailedKind) {} + PostOutOfBoundsCheckFailed(const Stmt* S, const void *tag = 0) + : PostStmt(S, PostOutOfBoundsCheckFailedKind, tag) {} static bool classof(const ProgramPoint* Location) { return Location->getKind() == PostOutOfBoundsCheckFailedKind; @@ -229,8 +232,8 @@ public: class PostUndefLocationCheckFailed : public PostStmt { public: - PostUndefLocationCheckFailed(const Stmt* S) - : PostStmt(S, PostUndefLocationCheckFailedKind) {} + PostUndefLocationCheckFailed(const Stmt* S, const void *tag = 0) + : PostStmt(S, PostUndefLocationCheckFailedKind, tag) {} static bool classof(const ProgramPoint* Location) { return Location->getKind() == PostUndefLocationCheckFailedKind; @@ -239,8 +242,8 @@ public: class PostNullCheckFailed : public PostStmt { public: - PostNullCheckFailed(const Stmt* S) - : PostStmt(S, PostNullCheckFailedKind) {} + PostNullCheckFailed(const Stmt* S, const void *tag = 0) + : PostStmt(S, PostNullCheckFailedKind, tag) {} static bool classof(const ProgramPoint* Location) { return Location->getKind() == PostNullCheckFailedKind; @@ -269,7 +272,8 @@ public: class PostPurgeDeadSymbols : public PostStmt { public: - PostPurgeDeadSymbols(const Stmt* S) : PostStmt(S, PostPurgeDeadSymbolsKind) {} + PostPurgeDeadSymbols(const Stmt* S, const void *tag = 0) + : PostStmt(S, PostPurgeDeadSymbolsKind, tag) {} static bool classof(const ProgramPoint* Location) { return Location->getKind() == PostPurgeDeadSymbolsKind; |