diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-11-11 03:26:34 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-11-11 03:26:34 +0000 |
commit | b4b817d704287836b52b34369009e682f208aa2b (patch) | |
tree | 2b7898371d40dd14735954712fd2344baa2a7b63 /lib/Analysis/GRCoreEngine.cpp | |
parent | 09b6d0e7931bf72674e4d752bd66b566cc01fe05 (diff) |
Refactor DereferenceChecker to use only the new Checker API instead of
the old builder API. This percolated a bunch of changes up to the
Checker class (where CheckLocation has been renamed VisitLocation) and
GRExprEngine. ProgramPoint now has the notion of a "LocationCheck"
point (with PreLoad and PreStore respectively), and a bunch of the old
ProgramPoints that are no longer used have been removed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRCoreEngine.cpp')
-rw-r--r-- | lib/Analysis/GRCoreEngine.cpp | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/lib/Analysis/GRCoreEngine.cpp b/lib/Analysis/GRCoreEngine.cpp index 87472472fd..b99ba4f257 100644 --- a/lib/Analysis/GRCoreEngine.cpp +++ b/lib/Analysis/GRCoreEngine.cpp @@ -418,51 +418,38 @@ void GRStmtNodeBuilder::GenerateAutoTransition(ExplodedNode* N) { Eng.WList->Enqueue(Succ, B, Idx+1); } -static inline PostStmt GetPostLoc(const Stmt* S, ProgramPoint::Kind K, - const LocationContext *L, const void *tag) { +static ProgramPoint GetProgramPoint(const Stmt *S, ProgramPoint::Kind K, + const LocationContext *LC, const void *tag){ switch (K) { default: - assert(false && "Invalid PostXXXKind."); - + assert(false && "Unhandled ProgramPoint kind"); + case ProgramPoint::PreStmtKind: + return PreStmt(S, LC, tag); case ProgramPoint::PostStmtKind: - return PostStmt(S, L, tag); - + return PostStmt(S, LC, tag); + case ProgramPoint::PreLoadKind: + return PreLoad(S, LC, tag); case ProgramPoint::PostLoadKind: - return PostLoad(S, L, tag); - - case ProgramPoint::PostUndefLocationCheckFailedKind: - return PostUndefLocationCheckFailed(S, L, tag); - - case ProgramPoint::PostLocationChecksSucceedKind: - return PostLocationChecksSucceed(S, L, tag); - - case ProgramPoint::PostOutOfBoundsCheckFailedKind: - return PostOutOfBoundsCheckFailed(S, L, tag); - - case ProgramPoint::PostNullCheckFailedKind: - return PostNullCheckFailed(S, L, tag); - + return PostLoad(S, LC, tag); + case ProgramPoint::PreStoreKind: + return PreStore(S, LC, tag); case ProgramPoint::PostStoreKind: - return PostStore(S, L, tag); - + return PostStore(S, LC, tag); case ProgramPoint::PostLValueKind: - return PostLValue(S, L, tag); - + return PostLValue(S, LC, tag); case ProgramPoint::PostPurgeDeadSymbolsKind: - return PostPurgeDeadSymbols(S, L, tag); + return PostPurgeDeadSymbols(S, LC, tag); } } ExplodedNode* -GRStmtNodeBuilder::generateNodeInternal(const Stmt* S, const GRState* State, +GRStmtNodeBuilder::generateNodeInternal(const Stmt* S, const GRState* state, ExplodedNode* Pred, ProgramPoint::Kind K, const void *tag) { - return K == ProgramPoint::PreStmtKind - ? generateNodeInternal(PreStmt(S, Pred->getLocationContext(),tag), - State, Pred) - : generateNodeInternal(GetPostLoc(S, K, Pred->getLocationContext(), tag), - State, Pred); + + const ProgramPoint &L = GetProgramPoint(S, K, Pred->getLocationContext(),tag); + return generateNodeInternal(L, state, Pred); } ExplodedNode* |