diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-06-30 16:57:41 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-06-30 16:57:41 +0000 |
commit | a0e071c861d11d1b890e00cfd3d5a2905714f492 (patch) | |
tree | 1f277f728c39f05dfe7992de238162f33474cc25 /clang/lib/Analysis/CFRefCount.cpp | |
parent | 9e08148f297679c1a0a20a0012f205a5bec98d6d (diff) | |
download | bcm5719-llvm-a0e071c861d11d1b890e00cfd3d5a2905714f492.tar.gz bcm5719-llvm-a0e071c861d11d1b890e00cfd3d5a2905714f492.zip |
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.
llvm-svn: 52904
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | clang/lib/Analysis/CFRefCount.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 03e886499b7..60a1a6a9c92 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -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); |