[cfe-commits] r50513 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRExprEngine.h lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Wed Apr 30 21:02:06 PDT 2008


Author: kremenek
Date: Wed Apr 30 23:02:04 2008
New Revision: 50513

URL: http://llvm.org/viewvc/llvm-project?rev=50513&view=rev
Log:
When processing "release", "retain", and "autorelease" messages return the
lval passed as an argument.

Fix: Inverted diagnostic messages.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h?rev=50513&r1=50512&r2=50513&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Wed Apr 30 23:02:04 2008
@@ -396,11 +396,17 @@
     return N == EntryNode ? CleanedState : N->getState();
   }
   
+public:
+  
+  // FIXME: Maybe make these accesible only within the StmtBuilder?
+  
   ValueState* SetRVal(ValueState* St, Expr* Ex, RVal V);
   
   ValueState* SetRVal(ValueState* St, const Expr* Ex, RVal V) {
     return SetRVal(St, const_cast<Expr*>(Ex), V);
   }
+  
+protected:
  
   ValueState* SetBlkExprRVal(ValueState* St, Expr* Ex, RVal V) {
     return StateMgr.SetRVal(St, Ex, V, true, false);

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

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Wed Apr 30 23:02:04 2008
@@ -1050,7 +1050,7 @@
   // Create a new state with the updated bindings.  
   ValueState StVals = *St;
   SetRefBindings(StVals, B);
-  St = StateMgr.getPersistentState(StVals);
+  St = Eng.SetRVal(StateMgr.getPersistentState(StVals), ME, V);
   
   // Create an error node if it exists.  
   if (hasErr)
@@ -1509,13 +1509,13 @@
   switch (TF.getLangOptions().getGCMode()) {
     default:
       assert(false);
+          
+    case LangOptions::GCOnly:
+      assert (TF.isGCEnabled());
+      return std::make_pair(&Msgs[0], &Msgs[0]+1);
       
     case LangOptions::NonGC:
       assert (!TF.isGCEnabled());
-      return std::make_pair(&Msgs[0], &Msgs[0]+1);
-    
-    case LangOptions::GCOnly:
-      assert (TF.isGCEnabled());
       return std::make_pair(&Msgs[1], &Msgs[1]+1);
     
     case LangOptions::HybridGC:





More information about the cfe-commits mailing list