[cfe-commits] r50690 - /cfe/trunk/lib/Analysis/CFRefCount.cpp
Ted Kremenek
kremenek at apple.com
Mon May 5 17:38:54 PDT 2008
Author: kremenek
Date: Mon May 5 19:38:54 2008
New Revision: 50690
URL: http://llvm.org/viewvc/llvm-project?rev=50690&view=rev
Log:
Added initialization code to generate initial set of ObjC method summaries (non-instance methods).
Modified:
cfe/trunk/lib/Analysis/CFRefCount.cpp
Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=50690&r1=50689&r2=50690&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Mon May 5 19:38:54 2008
@@ -229,14 +229,16 @@
RetainSummary* getMethodSummary(Selector S);
RetainSummary* getInitMethodSummary(Selector S);
- void InitializeInstanceSummaries();
+ void InitializeInstMethSummaries();
+ void InitializeMethSummaries();
public:
RetainSummaryManager(ASTContext& ctx, bool gcenabled)
: Ctx(ctx), GCEnabled(gcenabled) {
- InitializeInstanceSummaries();
+ InitializeInstMethSummaries();
+ InitializeMethSummaries();
}
~RetainSummaryManager();
@@ -523,7 +525,7 @@
return 0;
}
-void RetainSummaryManager::InitializeInstanceSummaries() {
+void RetainSummaryManager::InitializeInstMethSummaries() {
assert (ScratchArgs.empty());
@@ -546,6 +548,23 @@
ObjCInstMethSummaries[ GetUnarySelector("mutableCopyWithZone", Ctx) ] = Summ;
}
+void RetainSummaryManager::InitializeMethSummaries() {
+
+ assert (ScratchArgs.empty());
+
+ // Create the "init" selector.
+ RetainSummary* Summ = getPersistentSummary(RetEffect::MakeReceiverAlias());
+ ObjCMethSummaries[ GetNullarySelector("init", Ctx) ] = Summ;
+
+ // Create the "copy" selector.
+ RetEffect E = isGCEnabled() ? RetEffect::MakeNoRet() : RetEffect::MakeOwned();
+ Summ = getPersistentSummary(E);
+ ObjCMethSummaries[ GetNullarySelector("copy", Ctx) ] = Summ;
+
+ // Create the "mutableCopy" selector.
+ ObjCMethSummaries[ GetNullarySelector("mutableCopy", Ctx) ] = Summ;
+}
+
RetainSummary* RetainSummaryManager::getInstanceMethodSummary(Selector S) {
More information about the cfe-commits
mailing list