summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-28 05:29:13 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-28 05:29:13 +0000
commit21114f21c4ac8c06a0aaad05f2e47f068610febc (patch)
tree489a6d3b17ffbfeceac72760eb3ae0f8377737f5 /clang/lib/Analysis/CFRefCount.cpp
parentff3c2bdfeef96193e3923fe8b7452cca3d5890b6 (diff)
downloadbcm5719-llvm-21114f21c4ac8c06a0aaad05f2e47f068610febc.tar.gz
bcm5719-llvm-21114f21c4ac8c06a0aaad05f2e47f068610febc.zip
retain/release checker: More cleanups (no real functionality change).
llvm-svn: 63181
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index bbbe7646fd8..4e6544c98ee 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -2309,21 +2309,16 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode<GRState>* N,
const ExplodedGraph<GRState>& G,
BugReporter& BR) {
- // Check if the type state has changed.
-
- const GRState* PrevSt = PrevN->getState();
- GRStateRef CurrSt(N->getState(), cast<GRBugReporter>(BR).getStateManager());
+ // Check if the type state has changed.
+ GRStateManager &StMgr = cast<GRBugReporter>(BR).getStateManager();
+ GRStateRef PrevSt(PrevN->getState(), StMgr);
+ GRStateRef CurrSt(N->getState(), StMgr);
- RefBindings PrevB = PrevSt->get<RefBindings>();
- RefBindings CurrB = CurrSt.get<RefBindings>();
-
- const RefVal* PrevT = PrevB.lookup(Sym);
- const RefVal* CurrT = CurrB.lookup(Sym);
-
- if (!CurrT)
- return NULL;
-
- const RefVal& CurrV = *CurrB.lookup(Sym);
+ const RefVal* CurrT = CurrSt.get<RefBindings>(Sym);
+ if (!CurrT) return NULL;
+
+ const RefVal& CurrV = *CurrT;
+ const RefVal* PrevT = PrevSt.get<RefBindings>(Sym);
if (!PrevT) {
std::string sbuf;
@@ -2363,7 +2358,7 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode<GRState>* N,
}
// Determine if the typestate has changed.
- RefVal PrevV = *PrevB.lookup(Sym);
+ RefVal PrevV = *PrevT;
if (PrevV == CurrV)
return NULL;
OpenPOWER on IntegriCloud