]> granicus.if.org Git - clang/commitdiff
Added "Autorelease" ArgEffect to better simulate "autorelease" messages. Right
authorTed Kremenek <kremenek@apple.com>
Mon, 30 Jun 2008 16:57:41 +0000 (16:57 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 30 Jun 2008 16:57:41 +0000 (16:57 +0000)
now this does the same thing as "MayEscape", but more functionality will go in
here shortly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52904 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index 03e886499b74b57bb962da627acfe76bc890c166..60a1a6a9c92447db7492e5a1e12f273e9c66cd40 100644 (file)
@@ -100,7 +100,7 @@ namespace {
 /// 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 @@ void RetainSummaryManager::InitializeMethodSummaries() {
   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 @@ CFRefCount::RefBindings CFRefCount::Update(RefBindings B, SymbolID sym,
     default:
       assert (false && "Unhandled CFRef transition.");
 
-          
+    case Autorelease:          
     case MayEscape:
       if (V.getKind() == RefVal::Owned) {
         V = V ^ RefVal::NotOwned;
@@ -1835,7 +1835,7 @@ CFRefCount::RefBindings CFRefCount::Update(RefBindings B, SymbolID sym,
       }
       
       return B;
-      
+
     case StopTracking:
       return RefBFactory.Remove(B, sym);