diff options
author | Anna Zaks <ganna@apple.com> | 2011-10-18 23:06:48 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-10-18 23:06:48 +0000 |
commit | c9003c89c7aead1686aba89c8e3ddcea1f2bec54 (patch) | |
tree | 33ec4a356a4a66b44d723ff181a970d3de5b2556 /lib/StaticAnalyzer/Core | |
parent | 4e82d3cf6fd4c907265e3fa3aac0a835c35dc759 (diff) |
[analyzer] Move predecessor into the NodeBuilder context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core')
-rw-r--r-- | lib/StaticAnalyzer/Core/CoreEngine.cpp | 10 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngine.cpp | 6 |
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/StaticAnalyzer/Core/CoreEngine.cpp b/lib/StaticAnalyzer/Core/CoreEngine.cpp index a40a0dc683..93eb1423cf 100644 --- a/lib/StaticAnalyzer/Core/CoreEngine.cpp +++ b/lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -314,7 +314,7 @@ void CoreEngine::HandleBlockEntrance(const BlockEntrance &L, // Process the entrance of the block. if (CFGElement E = L.getFirstElement()) { - NodeBuilderContext Ctx(*this, L.getBlock()); + NodeBuilderContext Ctx(*this, L.getBlock(), Pred); StmtNodeBuilder Builder(Pred, 0, Ctx); SubEng.processCFGElement(E, Builder, Pred); } @@ -418,7 +418,7 @@ void CoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode *Pred) { void CoreEngine::HandleBranch(const Stmt *Cond, const Stmt *Term, const CFGBlock * B, ExplodedNode *Pred) { assert(B->succ_size() == 2); - NodeBuilderContext Ctx(*this, B); + NodeBuilderContext Ctx(*this, B, Pred); SubEng.processBranch(Cond, Term, Ctx, Pred, *(B->succ_begin()), *(B->succ_begin()+1)); } @@ -431,7 +431,7 @@ void CoreEngine::HandlePostStmt(const CFGBlock *B, unsigned StmtIdx, if (StmtIdx == B->size()) HandleBlockExit(B, Pred); else { - NodeBuilderContext Ctx(*this, B); + NodeBuilderContext Ctx(*this, B, Pred); StmtNodeBuilder Builder(Pred, StmtIdx, Ctx); SubEng.processCFGElement((*B)[StmtIdx], Builder, Pred); } @@ -508,7 +508,7 @@ ExplodedNode* NodeBuilder::generateNodeImpl(const ProgramPoint &Loc, StmtNodeBuilder::StmtNodeBuilder(ExplodedNode *N, unsigned idx, NodeBuilderContext &Ctx) - : NodeBuilder(N, Ctx), Idx(idx), + : NodeBuilder(Ctx), Idx(idx), PurgingDeadSymbols(false), BuildSinks(false), hasGeneratedNode(false), PointKind(ProgramPoint::PostStmtKind), Tag(0) { Deferred.insert(N); @@ -573,8 +573,6 @@ ExplodedNode *BranchNodeBuilder::generateNode(const ProgramState *State, if (!isFeasible(branch)) return NULL; - if (!NodePred) - NodePred = BuilderPred; ProgramPoint Loc = BlockEdge(C.Block, branch ? DstT:DstF, NodePred->getLocationContext()); ExplodedNode *Succ = generateNodeImpl(Loc, State, NodePred); diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 19b1a2fa73..5f1fe1b5e0 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -949,7 +949,7 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term, // Check for NULL conditions; e.g. "for(;;)" if (!Condition) { - BranchNodeBuilder NullCondBldr(Pred, BldCtx, DstT, DstF); + BranchNodeBuilder NullCondBldr(BldCtx, DstT, DstF); NullCondBldr.markInfeasible(false); NullCondBldr.generateNode(Pred->getState(), true, Pred); Engine.enqueue(NullCondBldr); @@ -960,7 +960,7 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term, Condition->getLocStart(), "Error evaluating branch"); - NodeBuilder CheckerBldr(Pred, BldCtx); + NodeBuilder CheckerBldr(BldCtx); getCheckerManager().runCheckersForBranchCondition(Condition, CheckerBldr, Pred, *this); @@ -971,7 +971,7 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term, if (PredI->isSink()) continue; - BranchNodeBuilder builder(PredI, BldCtx, DstT, DstF); + BranchNodeBuilder builder(BldCtx, DstT, DstF); const ProgramState *PrevState = Pred->getState(); SVal X = PrevState->getSVal(Condition); |