diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-06-18 05:34:07 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-06-18 05:34:07 +0000 |
commit | 331b0ac44b9eb0ffcba66b4f3f3f9adb27c2434f (patch) | |
tree | ffb6b8127a7735a6996f4777740a1c8a135530a8 /lib/Analysis/GRCoreEngine.cpp | |
parent | 60c5e4263b5146aa6c82ef1b6c1dbd391a285c95 (diff) |
Added a new ProgramPoint: PostPurgeDeadSymbols. This new program point distinguishes between the cases when we just evaluated the transfer function of a Stmt* (PostStmt) or performed a load (PostLoad). This solves a caching bug observed in a recent bug report.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRCoreEngine.cpp')
-rw-r--r-- | lib/Analysis/GRCoreEngine.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/Analysis/GRCoreEngine.cpp b/lib/Analysis/GRCoreEngine.cpp index 05f9303856..7c2ca0c13f 100644 --- a/lib/Analysis/GRCoreEngine.cpp +++ b/lib/Analysis/GRCoreEngine.cpp @@ -317,12 +317,30 @@ void GRStmtNodeBuilderImpl::GenerateAutoTransition(ExplodedNodeImpl* N) { Eng.WList->Enqueue(Succ, B, Idx+1); } +static inline ProgramPoint GetPostLoc(Stmt* S, ProgramPoint::Kind K) { + switch (K) { + default: + assert(false && "Invalid PostXXXKind."); + + case ProgramPoint::PostStmtKind: + return PostStmt(S); + + case ProgramPoint::PostLoadKind: + return PostLoad(S); + + case ProgramPoint::PostPurgeDeadSymbolsKind: + return PostPurgeDeadSymbols(S); + } +} + ExplodedNodeImpl* GRStmtNodeBuilderImpl::generateNodeImpl(Stmt* S, void* State, - ExplodedNodeImpl* Pred, bool isLoad) { + ExplodedNodeImpl* Pred, + ProgramPoint::Kind K) { bool IsNew; - ProgramPoint Loc = isLoad ? PostLoad(S) : PostStmt(S); + ProgramPoint Loc = GetPostLoc(S, K); + ExplodedNodeImpl* N = Eng.G->getNodeImpl(Loc, State, &IsNew); N->addPredecessor(Pred); Deferred.erase(Pred); |