diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-28 21:44:40 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-28 21:44:40 +0000 |
commit | abf439731bc4f56df2df9e54d6c242e2c633f5ca (patch) | |
tree | ba2e9b2624a43880e069e2364e7d1430da3b6b71 /lib/Analysis/CFRefCount.cpp | |
parent | 64cfdb7da3cb744642fe8a99ad5c851ad3c930b2 (diff) |
retain/release checker: Always generate an "autorelease" summary for an "autorelease" message, and have the summary processing logic treat it as a no-op in GC mode. This change is motivated to encode more of the semantics in the summaries themselves for eventual better diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 625eda4fb1..2d5cb5f5b8 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -979,13 +979,11 @@ void RetainSummaryManager::InitializeClassMethodSummaries() { getPersistentSummary(RetEffect::MakeNotOwned(RetEffect::ObjC))); // Create the [NSAutoreleasePool addObject:] summary. - if (!isGCEnabled()) { - ScratchArgs.push_back(std::make_pair(0, Autorelease)); - addClsMethSummary(&Ctx.Idents.get("NSAutoreleasePool"), - GetUnarySelector("addObject", Ctx), - getPersistentSummary(RetEffect::MakeNoRet(), - DoNothing, DoNothing)); - } + ScratchArgs.push_back(std::make_pair(0, Autorelease)); + addClsMethSummary(&Ctx.Idents.get("NSAutoreleasePool"), + GetUnarySelector("addObject", Ctx), + getPersistentSummary(RetEffect::MakeNoRet(), + DoNothing, DoNothing)); } void RetainSummaryManager::InitializeMethodSummaries() { @@ -1023,7 +1021,7 @@ void RetainSummaryManager::InitializeMethodSummaries() { addNSObjectMethSummary(GetNullarySelector("drain", Ctx), Summ); // Create the "autorelease" selector. - Summ = getPersistentSummary(E, isGCEnabled() ? DoNothing : Autorelease); + Summ = getPersistentSummary(E, Autorelease); addNSObjectMethSummary(GetNullarySelector("autorelease", Ctx), Summ); // For NSWindow, allocated objects are (initially) self-owned. @@ -2076,7 +2074,9 @@ RefBindings CFRefCount::Update(RefBindings B, SymbolRef sym, } return B; - case Autorelease: + case Autorelease: + if (isGCEnabled()) return B; + // Fall-through. case StopTracking: return RefBFactory.Remove(B, sym); |