SaveAndRestore<bool> OldSink(Builder->BuildSinks);
if (isa<lval::FuncVal>(L))
- if (cast<lval::FuncVal>(L).getDecl()->getAttr<NoReturnAttr>()) {
- for (NodeSet::iterator I=Dst.begin(), E=Dst.end(); I != E; ++I ) {
-
- NodeTy* N = *I;
-
- if (!N->isSink())
- N->markAsSink();
- }
-
+ if (cast<lval::FuncVal>(L).getDecl()->getAttr<NoReturnAttr>())
Builder->BuildSinks = true;
- }
// Evaluate the call.
EvalCall(Dst, CE, cast<LVal>(L), *DI);
- if (Dst.size() == size)
+ if (!Builder->BuildSinks && Dst.size() == size)
Nodify(Dst, CE, *DI, St);
}
}
}
NodeTy* Nodify(ExplodedNodeSet<StateTy>& Dst, Stmt* S,
- NodeTy* Pred, StateTy* St) {
+ NodeTy* Pred, StateTy* St) {
+
// If the state hasn't changed, don't generate a new node.
- if (St == Pred->getState()) {
+ if (!BuildSinks && St == Pred->getState()) {
Dst.Add(Pred);
return NULL;
}
NodeTy* N = generateNode(S, St, Pred);
- if (N && BuildSinks)
- N->markAsSink();
- else
- Dst.Add(N);
+ if (N) {
+ if (BuildSinks)
+ N->markAsSink();
+ else
+ Dst.Add(N);
+ }
return N;
}