From 611a15a18f34de57870f66b57b6d287fd29a9ad1 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 28 Jan 2009 05:29:13 +0000 Subject: [PATCH] retain/release checker: More cleanups (no real functionality change). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63181 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/CFRefCount.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index bbbe7646fd..4e6544c98e 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -2309,21 +2309,16 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode* N, const ExplodedGraph& G, BugReporter& BR) { - // Check if the type state has changed. - - const GRState* PrevSt = PrevN->getState(); - GRStateRef CurrSt(N->getState(), cast(BR).getStateManager()); + // Check if the type state has changed. + GRStateManager &StMgr = cast(BR).getStateManager(); + GRStateRef PrevSt(PrevN->getState(), StMgr); + GRStateRef CurrSt(N->getState(), StMgr); - RefBindings PrevB = PrevSt->get(); - RefBindings CurrB = CurrSt.get(); - - 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(Sym); + if (!CurrT) return NULL; + + const RefVal& CurrV = *CurrT; + const RefVal* PrevT = PrevSt.get(Sym); if (!PrevT) { std::string sbuf; @@ -2363,7 +2358,7 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode* N, } // Determine if the typestate has changed. - RefVal PrevV = *PrevB.lookup(Sym); + RefVal PrevV = *PrevT; if (PrevV == CurrV) return NULL; -- 2.50.1