Added initialization code to generate initial set of ObjC method summaries (non-instance methods).

llvm-svn: 50690
This commit is contained in:
Ted Kremenek 2008-05-06 00:38:54 +00:00
parent 0806f910d4
commit be7c56ed78
1 changed files with 22 additions and 3 deletions

View File

@ -229,14 +229,16 @@ class RetainSummaryManager {
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 @@ RetainSummary* RetainSummaryManager::getMethodSummary(Selector S) {
return 0;
}
void RetainSummaryManager::InitializeInstanceSummaries() {
void RetainSummaryManager::InitializeInstMethSummaries() {
assert (ScratchArgs.empty());
@ -546,6 +548,23 @@ void RetainSummaryManager::InitializeInstanceSummaries() {
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) {