[cfe-commits] r63181 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Tue Jan 27 21:29:14 PST 2009


Author: kremenek
Date: Tue Jan 27 23:29:13 2009
New Revision: 63181

URL: http://llvm.org/viewvc/llvm-project?rev=63181&view=rev
Log:
retain/release checker: More cleanups (no real functionality change).

Modified:
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=63181&r1=63180&r2=63181&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Jan 27 23:29:13 2009
@@ -2309,21 +2309,16 @@
                                             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 @@
   }
   
   // Determine if the typestate has changed.  
-  RefVal PrevV = *PrevB.lookup(Sym);
+  RefVal PrevV = *PrevT;
   
   if (PrevV == CurrV)
     return NULL;





More information about the cfe-commits mailing list