C.ContextPred->getLocationContext()->getCurrentStackFrame(),
C.Block->getBlockID());
}
+
+ void takeNodes(const ExplodedNodeSet &S) {
+ for (ExplodedNodeSet::iterator I = S.begin(), E = S.end(); I != E; ++I )
+ Frontier.erase(*I);
+ }
+
+ void takeNodes(ExplodedNode *N) {
+ Frontier.erase(N);
+ }
+
+ void addNodes(const ExplodedNodeSet &S) {
+ Frontier.insert(S);
+ }
+
+ void addNodes(ExplodedNode *N) {
+ Frontier.Add(N);
+ }
+
};
class CommonNodeBuilder {
BuildSinks = Tmp;
return N;
}
-
- void takeNodes(const ExplodedNodeSet &S) {
- for (ExplodedNodeSet::iterator I = S.begin(), E = S.end(); I != E; ++I )
- Frontier.erase(*I);
- }
-
- void takeNodes(ExplodedNode *N) {
- Frontier.erase(N);
- }
-
- void addNodes(const ExplodedNodeSet &S) {
- Frontier.insert(S);
- }
-
- void addNodes(ExplodedNode *N) {
- Frontier.Add(N);
- }
};
class BranchNodeBuilder: public NodeBuilder {
void ExprEngine::VisitCompoundLiteralExpr(const CompoundLiteralExpr *CL,
ExplodedNode *Pred,
ExplodedNodeSet &Dst) {
+ PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext);
+ Builder->takeNodes(Pred);
+
const InitListExpr *ILE
= cast<InitListExpr>(CL->getInitializer()->IgnoreParens());
state = state->bindCompoundLiteral(CL, LC, ILV);
if (CL->isLValue())
- MakeNode(Dst, CL, Pred, state->BindExpr(CL, state->getLValue(CL, LC)));
+ B.generateNode(CL, Pred, state->BindExpr(CL, state->getLValue(CL, LC)));
else
- MakeNode(Dst, CL, Pred, state->BindExpr(CL, ILV));
+ B.generateNode(CL, Pred, state->BindExpr(CL, ILV));
+ Builder->addNodes(Dst);
}
void ExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred,
ExplodedNodeSet dstPreVisit;
getCheckerManager().runCheckersForPreStmt(dstPreVisit, Pred, DS, *this);
+ PureStmtNodeBuilder B(dstPreVisit, Dst, *currentBuilderContext);
+ Builder->takeNodes(dstPreVisit);
const VarDecl *VD = dyn_cast<VarDecl>(D);
-
for (ExplodedNodeSet::iterator I = dstPreVisit.begin(), E = dstPreVisit.end();
I!=E; ++I) {
ExplodedNode *N = *I;
InitVal = svalBuilder.getConjuredSymbolVal(NULL, InitEx,
Builder->getCurrentBlockCount());
}
-
+ B.takeNodes(N);
evalBind(Dst, DS, N, state->getLValue(VD, LC), InitVal, true);
+ B.addNodes(Dst);
}
else {
- MakeNode(Dst, DS, N, state->bindDeclWithNoInit(state->getRegion(VD, LC)));
+ B.generateNode(DS, N,state->bindDeclWithNoInit(state->getRegion(VD, LC)));
}
}
+ Builder->addNodes(Dst);
}
void ExprEngine::VisitLogicalExpr(const BinaryOperator* B, ExplodedNode *Pred,