aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-03-04 23:39:43 +0000
committerTed Kremenek <kremenek@apple.com>2008-03-04 23:39:43 +0000
commit5c684c4be01fb98077a9b5e07ca1fdc01d8d97cb (patch)
tree6021b5ac991548f8739f85e8aa6ccc63e355e1d4
parentf6f5ef4aaa66b60270e84d1fe1292886369d2f38 (diff)
Moved implementation of GRExprEngine::Nodify into GRStmtNodeBuilder. This will
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
-rw-r--r--Analysis/GRExprEngine.cpp24
-rw-r--r--include/clang/Analysis/PathSensitive/GRCoreEngine.h17
-rw-r--r--include/clang/Analysis/PathSensitive/GRExprEngine.h5
3 files changed, 20 insertions, 26 deletions
diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp
index a011e7b360..61d10a4ecc 100644
--- a/Analysis/GRExprEngine.cpp
+++ b/Analysis/GRExprEngine.cpp
@@ -433,30 +433,6 @@ void GRExprEngine::ProcessStmt(Stmt* S, StmtNodeBuilder& builder) {
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) {
diff --git a/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/include/clang/Analysis/PathSensitive/GRCoreEngine.h
index 93f30c2027..b8541309a1 100644
--- a/include/clang/Analysis/PathSensitive/GRCoreEngine.h
+++ b/include/clang/Analysis/PathSensitive/GRCoreEngine.h
@@ -184,7 +184,22 @@ public:
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 {
diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h
index a8827472df..2937dd6129 100644
--- a/include/clang/Analysis/PathSensitive/GRExprEngine.h
+++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h
@@ -320,7 +320,10 @@ protected:
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.