allow us to pass the builder to plug-in transfer functions and allow those
functions to create intermediate nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47919
91177308-0d34-0410-b5e6-
96231b3b80d8
Builder = NULL;
}
-GRExprEngine::NodeTy*
-GRExprEngine::Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred, ValueState* St) {
-
- // If the state hasn't changed, don't generate a new node.
- if (St == Pred->getState()) {
- Dst.Add(Pred);
- return NULL;
- }
-
- NodeTy* N = Builder->generateNode(S, St, Pred);
- Dst.Add(N);
-
- return N;
-}
-
-#if 0
-void GRExprEngine::Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred,
- const ValueState::BufferTy& SB) {
-
- for (ValueState::BufferTy::const_iterator I=SB.begin(), E=SB.end(); I!=E; ++I)
- Nodify(Dst, S, Pred, *I);
-}
-#endif
-
void GRExprEngine::VisitDeclRefExpr(DeclRefExpr* D, NodeTy* Pred, NodeSet& Dst){
if (D != CurrentStmt) {
NodeTy* generateNode(Stmt* S, StateTy State) {
void *state = GRTrait<StateTy>::toPtr(State);
return static_cast<NodeTy*>(NB.generateNodeImpl(S, state));
- }
+ }
+
+ NodeTy* Nodify(ExplodedNodeSet<NodeTy> Dst, Stmt* S,
+ NodeTy* Pred, StateTy St) {
+
+ // If the state hasn't changed, don't generate a new node.
+ if (St == Pred->getState()) {
+ Dst.Add(Pred);
+ return NULL;
+ }
+
+ NodeTy* N = generateNode(S, St, Pred);
+ Dst.Add(N);
+ return N;
+ }
+
};
class GRBranchNodeBuilderImpl {
ValueState* AssumeSymInt(ValueState* St, bool Assumption,
const SymIntConstraint& C, bool& isFeasible);
- NodeTy* Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred, ValueState* St);
+ NodeTy* Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred, ValueState* St) {
+ assert (Builder && "GRStmtNodeBuilder not present.");
+ return Builder->Nodify(Dst, S, Pred, St);
+ }
#if 0
/// Nodify - This version of Nodify is used to batch process a set of states.