forked from OSchip/llvm-project
Added initialization code to generate initial set of ObjC method summaries (non-instance methods).
llvm-svn: 50690
This commit is contained in:
parent
0806f910d4
commit
be7c56ed78
|
@ -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) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue