aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-08-20 05:13:36 +0000
committerTed Kremenek <kremenek@apple.com>2009-08-20 05:13:36 +0000
commitac02f20424d35121f66c7271b1a8538df8149188 (patch)
tree16f3ac1e5aba6d52256d3d796632d25dc5c22e4b /lib/Analysis/CFRefCount.cpp
parentcaac0899b528102b88a7d49d3324d7b39d2ae88d (diff)
retain/release checker: Treat NSObject method '-awakeAfterUsingCoder:'
just as if it behaved like an init function. This fixes <rdar://problem/7129086>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index b965393601..1b7a746f26 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -635,8 +635,8 @@ class VISIBILITY_HIDDEN RetainSummaryManager {
/// objects.
RetEffect ObjCAllocRetE;
- /// ObjCInitRetE - Default return effect for init methods returning Objective-C
- /// objects.
+ /// ObjCInitRetE - Default return effect for init methods returning
+ /// Objective-C objects.
RetEffect ObjCInitRetE;
RetainSummary DefaultSummary;
@@ -1452,8 +1452,13 @@ void RetainSummaryManager::InitializeMethodSummaries() {
// Create the "init" selector. It just acts as a pass-through for the
// receiver.
- addNSObjectMethSummary(GetNullarySelector("init", Ctx),
- getPersistentSummary(ObjCInitRetE, DecRefMsg));
+ RetainSummary *InitSumm = getPersistentSummary(ObjCInitRetE, DecRefMsg);
+ addNSObjectMethSummary(GetNullarySelector("init", Ctx), InitSumm);
+
+ // awakeAfterUsingCoder: behaves basically like an 'init' method. It
+ // claims the receiver and returns a retained object.
+ addNSObjectMethSummary(GetUnarySelector("awakeAfterUsingCoder", Ctx),
+ InitSumm);
// The next methods are allocators.
RetainSummary *AllocSumm = getPersistentSummary(ObjCAllocRetE);