aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-08-11 00:11:21 +0000
committerAnna Zaks <ganna@apple.com>2011-08-11 00:11:21 +0000
commit0e89061a399bae32f0eca5b85658ad66a58c504d (patch)
tree1b40b132a64a83b368d3dd080e1bca9f9fcbc8bd
parentdb5e8cd095d1ffdd18f5620ad2348b5f386bebe3 (diff)
Cleanup: remove CleanedSate member and GetState() wrapper from StmtNodeBuilder, not needed as of r137273.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137284 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h4
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h14
-rw-r--r--lib/StaticAnalyzer/Core/CFRefCount.cpp8
-rw-r--r--lib/StaticAnalyzer/Core/CheckerContext.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/CoreEngine.cpp1
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngine.cpp4
6 files changed, 9 insertions, 24 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index 27c52c3b12..62887cd2e2 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -71,7 +71,7 @@ public:
ExplodedNodeSet &getNodeSet() { return Dst; }
StmtNodeBuilder &getNodeBuilder() { return B; }
ExplodedNode *&getPredecessor() { return Pred; }
- const GRState *getState() { return ST ? ST : B.GetState(Pred); }
+ const GRState *getState() { return ST ? ST : Pred->getState(); }
const Stmt *getStmt() const { return statement; }
ASTContext &getASTContext() {
@@ -151,7 +151,7 @@ public:
assert(state);
// If the 'state' is not new, we need to check if the cached state 'ST'
// is new.
- if (state != getState() || (ST && ST != B.GetState(Pred)))
+ if (state != getState() || (ST && ST != Pred->getState()))
// state is new or equals to ST.
generateNode(state, true, tag);
else
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
index 91ec403455..19daeda6b5 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
@@ -172,9 +172,6 @@ public:
ProgramPoint::Kind PointKind;
const void *Tag;
- const GRState* CleanedState;
-
-
typedef llvm::SmallPtrSet<ExplodedNode*,5> DeferredTy;
DeferredTy Deferred;
@@ -191,10 +188,6 @@ public:
// FIXME: This should not be exposed.
WorkList *getWorkList() { return Eng.WList; }
- void SetCleanedState(const GRState* St) {
- CleanedState = St;
- }
-
BlockCounter getBlockCounter() const { return Eng.WList->getBlockCounter();}
unsigned getCurrentBlockCount() const {
@@ -252,13 +245,6 @@ public:
unsigned getIndex() const { return Idx; }
- const GRState* GetState(ExplodedNode* Pred) const {
- if (Pred == getPredecessor())
- return CleanedState;
- else
- return Pred->getState();
- }
-
ExplodedNode* MakeNode(ExplodedNodeSet& Dst, const Stmt* S,
ExplodedNode* Pred, const GRState* St) {
return MakeNode(Dst, S, Pred, St, PointKind);
diff --git a/lib/StaticAnalyzer/Core/CFRefCount.cpp b/lib/StaticAnalyzer/Core/CFRefCount.cpp
index 4c3381f407..ad809e7649 100644
--- a/lib/StaticAnalyzer/Core/CFRefCount.cpp
+++ b/lib/StaticAnalyzer/Core/CFRefCount.cpp
@@ -2832,9 +2832,9 @@ void CFRefCount::evalCall(ExplodedNodeSet& Dst,
assert(Summ);
evalSummary(Dst, Eng, Builder, CE,
- CallOrObjCMessage(CE, Builder.GetState(Pred)),
+ CallOrObjCMessage(CE, Pred->getState()),
InstanceReceiver(), *Summ,L.getAsRegion(),
- Pred, Builder.GetState(Pred));
+ Pred, Pred->getState());
}
void CFRefCount::evalObjCMessage(ExplodedNodeSet& Dst,
@@ -2850,7 +2850,7 @@ void CFRefCount::evalObjCMessage(ExplodedNodeSet& Dst,
assert(Summ && "RetainSummary is null");
evalSummary(Dst, Eng, Builder, msg.getOriginExpr(),
- CallOrObjCMessage(msg, Builder.GetState(Pred)),
+ CallOrObjCMessage(msg, Pred->getState()),
InstanceReceiver(msg, Pred->getLocationContext()), *Summ, NULL,
Pred, state);
}
@@ -2919,7 +2919,7 @@ void CFRefCount::evalReturn(ExplodedNodeSet& Dst,
if (!RetE)
return;
- const GRState *state = Builder.GetState(Pred);
+ const GRState *state = Pred->getState();
SymbolRef Sym = state->getSValAsScalarOrLoc(RetE).getAsLocSymbol();
if (!Sym)
diff --git a/lib/StaticAnalyzer/Core/CheckerContext.cpp b/lib/StaticAnalyzer/Core/CheckerContext.cpp
index f6fb8f256c..3920a4990a 100644
--- a/lib/StaticAnalyzer/Core/CheckerContext.cpp
+++ b/lib/StaticAnalyzer/Core/CheckerContext.cpp
@@ -23,7 +23,7 @@ CheckerContext::~CheckerContext() {
// if we are building sinks or we generated a node and decided to not
// add it as a transition.
if (Dst.size() == size && !B.BuildSinks && !B.hasGeneratedNode) {
- if (ST && ST != B.GetState(Pred)) {
+ if (ST && ST != Pred->getState()) {
static int autoTransitionTag = 0;
addTransition(ST, &autoTransitionTag);
}
diff --git a/lib/StaticAnalyzer/Core/CoreEngine.cpp b/lib/StaticAnalyzer/Core/CoreEngine.cpp
index 1103ac65de..4b966285ac 100644
--- a/lib/StaticAnalyzer/Core/CoreEngine.cpp
+++ b/lib/StaticAnalyzer/Core/CoreEngine.cpp
@@ -487,7 +487,6 @@ StmtNodeBuilder::StmtNodeBuilder(const CFGBlock* b, unsigned idx,
PurgingDeadSymbols(false), BuildSinks(false), hasGeneratedNode(false),
PointKind(ProgramPoint::PostStmtKind), Tag(0) {
Deferred.insert(N);
- CleanedState = Pred->getState();
}
StmtNodeBuilder::~StmtNodeBuilder() {
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 72f2403ac4..e2c0fc1b7e 100644
--- a/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1592,7 +1592,7 @@ void ExprEngine::evalLocation(ExplodedNodeSet &Dst, const Stmt *S,
}
ExplodedNodeSet Src;
- if (Builder->GetState(Pred) == state) {
+ if (Pred->getState() == state) {
Src.Add(Pred);
} else {
// Associate this new state with an ExplodedNode.
@@ -2017,7 +2017,7 @@ void ExprEngine::VisitObjCMessage(const ObjCMessage &msg,
Builder->BuildSinks = true;
// Dispatch to plug-in transfer function.
- evalObjCMessage(dstEval, msg, Pred, Builder->GetState(Pred));
+ evalObjCMessage(dstEval, msg, Pred, Pred->getState());
}
// Handle the case where no nodes where generated. Auto-generate that