diff options
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); |