summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-28 21:44:40 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-28 21:44:40 +0000
commitc78320960513fe9f193104cbb07b0a5711c81ee0 (patch)
tree07ace5d2d1c8c19330d037b13ad8c3cadb8c6149 /clang/lib
parent511d5ece2b845e265c361a1212b0f8c355413c4a (diff)
downloadbcm5719-llvm-c78320960513fe9f193104cbb07b0a5711c81ee0.tar.gz
bcm5719-llvm-c78320960513fe9f193104cbb07b0a5711c81ee0.zip
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.
llvm-svn: 63241
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 625eda4fb19..2d5cb5f5b89 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud