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

Ted Kremenek kremenek at apple.com
Mon Jun 30 09:57:42 PDT 2008


Author: kremenek
Date: Mon Jun 30 11:57:41 2008
New Revision: 52904

URL: http://llvm.org/viewvc/llvm-project?rev=52904&view=rev
Log:
Added "Autorelease" ArgEffect to better simulate "autorelease" messages. Right
now this does the same thing as "MayEscape", but more functionality will go in
here shortly.

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=52904&r1=52903&r2=52904&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Mon Jun 30 11:57:41 2008
@@ -100,7 +100,7 @@
 /// ArgEffect is used to summarize a function/method call's effect on a
 /// particular argument.
 enum ArgEffect { IncRef, DecRef, DoNothing, StopTracking, MayEscape,
-                 SelfOwn };
+                 SelfOwn, Autorelease };
 
 /// ArgEffects summarizes the effects of a function/method call on all of
 /// its arguments.
@@ -876,7 +876,7 @@
   addNSObjectMethSummary(GetNullarySelector("drain", Ctx), Summ);
 
   // Create the "autorelease" selector.
-  Summ = getPersistentSummary(E, isGCEnabled() ? DoNothing : StopTracking);
+  Summ = getPersistentSummary(E, isGCEnabled() ? DoNothing : Autorelease);
   addNSObjectMethSummary(GetNullarySelector("autorelease", Ctx), Summ);
 
   // For NSWindow, allocated objects are (initially) self-owned.
@@ -1818,7 +1818,7 @@
     default:
       assert (false && "Unhandled CFRef transition.");
 
-          
+    case Autorelease:          
     case MayEscape:
       if (V.getKind() == RefVal::Owned) {
         V = V ^ RefVal::NotOwned;
@@ -1835,7 +1835,7 @@
       }
       
       return B;
-      
+
     case StopTracking:
       return RefBFactory.Remove(B, sym);
       





More information about the cfe-commits mailing list