forked from OSchip/llvm-project
parent
5cbfb3b423
commit
4ccdc73f44
|
@ -586,7 +586,6 @@ enum ObjCInstanceTypeFamily {
|
|||
OIT_None,
|
||||
OIT_Array,
|
||||
OIT_Dictionary,
|
||||
OIT_MemManage,
|
||||
OIT_Singleton
|
||||
};
|
||||
|
||||
|
|
|
@ -700,11 +700,6 @@ void ObjCMigrateASTConsumer::migrateMethodInstanceType(ASTContext &Ctx,
|
|||
case OIT_Dictionary:
|
||||
ClassName = "NSDictionary";
|
||||
break;
|
||||
// For methods where Clang automatically infers instancetype from the selector
|
||||
// (e.g., all -init* methods), we should not suggest "instancetype" because it
|
||||
// is redundant,
|
||||
case OIT_MemManage:
|
||||
return;
|
||||
case OIT_Singleton:
|
||||
migrateFactoryMethod(Ctx, CDecl, OM, OIT_Singleton);
|
||||
return;
|
||||
|
|
|
@ -461,20 +461,12 @@ ObjCInstanceTypeFamily Selector::getInstTypeMethodFamily(Selector sel) {
|
|||
if (name.empty()) return OIT_None;
|
||||
switch (name.front()) {
|
||||
case 'a':
|
||||
if (startsWithWord(name, "alloc")) return OIT_MemManage;
|
||||
else
|
||||
if (startsWithWord(name, "array")) return OIT_Array;
|
||||
if (startsWithWord(name, "array")) return OIT_Array;
|
||||
break;
|
||||
case 'd':
|
||||
if (startsWithWord(name, "dictionary")) return OIT_Dictionary;
|
||||
if (startsWithWord(name, "default")) return OIT_Singleton;
|
||||
break;
|
||||
case 'i':
|
||||
if (startsWithWord(name, "init")) return OIT_MemManage;
|
||||
break;
|
||||
case 'r':
|
||||
if (startsWithWord(name, "retain")) return OIT_MemManage;
|
||||
break;
|
||||
case 's':
|
||||
if (startsWithWord(name, "shared") ||
|
||||
startsWithWord(name, "standard"))
|
||||
|
|
Loading…
Reference in New Issue