aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/ExprEngine.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-10-24 18:25:53 +0000
committerAnna Zaks <ganna@apple.com>2011-10-24 18:25:53 +0000
commit1aae01a8308d2f8e31adab3f4d7ac35543aac680 (patch)
tree81807c40f9fd0a60caa539fe85407d69c6b6760f /lib/StaticAnalyzer/Core/ExprEngine.cpp
parentfe9b2a84105b898b48a2935d50d209c880f36aa3 (diff)
[analyzer] Pass external Dst set to NodeBuilder
This moves the responsibility for storing the output node set from the builder to the clients. The builder is just responsible for transforming an input set into the output set: {SrcSet/SrcNode} -> {Frontier}. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngine.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 269d7c74ee..5742266de2 100644
--- a/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -945,15 +945,14 @@ static SVal RecoverCastedSymbol(ProgramStateManager& StateMgr,
void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term,
NodeBuilderContext& BldCtx,
ExplodedNode *Pred,
+ ExplodedNodeSet &Dst,
const CFGBlock *DstT,
const CFGBlock *DstF) {
-
// Check for NULL conditions; e.g. "for(;;)"
if (!Condition) {
- BranchNodeBuilder NullCondBldr(BldCtx, DstT, DstF);
+ BranchNodeBuilder NullCondBldr(Pred, Dst, BldCtx, DstT, DstF);
NullCondBldr.markInfeasible(false);
NullCondBldr.generateNode(Pred->getState(), true, Pred);
- Engine.enqueue(NullCondBldr);
return;
}
@@ -961,18 +960,19 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term,
Condition->getLocStart(),
"Error evaluating branch");
- NodeBuilder CheckerBldr(BldCtx);
+ ExplodedNodeSet TmpCheckersOut;
+ NodeBuilder CheckerBldr(Pred, TmpCheckersOut, BldCtx);
getCheckerManager().runCheckersForBranchCondition(Condition, CheckerBldr,
Pred, *this);
- for (NodeBuilder::iterator I = CheckerBldr.results_begin(),
- E = CheckerBldr.results_end(); E != I; ++I) {
+ BranchNodeBuilder builder(CheckerBldr.getResults(), Dst, BldCtx, DstT, DstF);
+ for (NodeBuilder::iterator I = CheckerBldr.begin(),
+ E = CheckerBldr.end(); E != I; ++I) {
ExplodedNode *PredI = *I;
if (PredI->isSink())
continue;
- BranchNodeBuilder builder(BldCtx, DstT, DstF);
const ProgramState *PrevState = Pred->getState();
SVal X = PrevState->getSVal(Condition);
@@ -998,8 +998,6 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term,
if (X.isUnknownOrUndef()) {
builder.generateNode(MarkBranch(PrevState, Term, true), true, PredI);
builder.generateNode(MarkBranch(PrevState, Term, false), false, PredI);
- // Enqueue the results into the work list.
- Engine.enqueue(builder);
continue;
}
@@ -1020,9 +1018,6 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term,
else
builder.markInfeasible(false);
}
-
- // Enqueue the results into the work list.
- Engine.enqueue(builder);
}
}