ObjectiveC migrator. Change naming hueristic for
deprecated categories, fixes a typo reported by Jordan. llvm-svn: 193759
This commit is contained in:
parent
d29853564d
commit
d41dbadacd
|
@ -44,7 +44,7 @@ class ObjCMigrateASTConsumer : public ASTConsumer {
|
|||
|
||||
void migrateDecl(Decl *D);
|
||||
void migrateObjCInterfaceDecl(ASTContext &Ctx, ObjCContainerDecl *D);
|
||||
void migregateDeprecatedAnnotation(ASTContext &Ctx, ObjCCategoryDecl *CatDecl);
|
||||
void migrateDeprecatedAnnotation(ASTContext &Ctx, ObjCCategoryDecl *CatDecl);
|
||||
void migrateProtocolConformance(ASTContext &Ctx,
|
||||
const ObjCImplementationDecl *ImpDecl);
|
||||
void CacheObjCNSIntegerTypedefed(const TypedefDecl *TypedefDcl);
|
||||
|
@ -425,10 +425,10 @@ void ObjCMigrateASTConsumer::migrateObjCInterfaceDecl(ASTContext &Ctx,
|
|||
}
|
||||
}
|
||||
|
||||
void ObjCMigrateASTConsumer::migregateDeprecatedAnnotation(ASTContext &Ctx,
|
||||
void ObjCMigrateASTConsumer::migrateDeprecatedAnnotation(ASTContext &Ctx,
|
||||
ObjCCategoryDecl *CatDecl) {
|
||||
StringRef Name = CatDecl->getName();
|
||||
if (!Name.startswith("NS") || !Name.endswith("Deprecated"))
|
||||
if (!Name.endswith("Deprecated"))
|
||||
return;
|
||||
|
||||
if (!Ctx.Idents.get("DEPRECATED").hasMacroDefinition())
|
||||
|
@ -1541,7 +1541,7 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) {
|
|||
if (ObjCCategoryDecl *CatDecl = dyn_cast<ObjCCategoryDecl>(*D)) {
|
||||
migrateObjCInterfaceDecl(Ctx, CatDecl);
|
||||
if (ASTMigrateActions & FrontendOptions::ObjCMT_Annotation)
|
||||
migregateDeprecatedAnnotation(Ctx, CatDecl);
|
||||
migrateDeprecatedAnnotation(Ctx, CatDecl);
|
||||
}
|
||||
else if (ObjCProtocolDecl *PDecl = dyn_cast<ObjCProtocolDecl>(*D))
|
||||
ObjCProtocolDecls.insert(PDecl);
|
||||
|
|
|
@ -39,3 +39,10 @@
|
|||
@property int P2 DEPRECATED;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSArray (Deprecated)
|
||||
- (void)getObjects:(id __unsafe_unretained [])objects;
|
||||
- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
|
||||
@property int P1;
|
||||
@property int P2 DEPRECATED;
|
||||
@end
|
||||
|
|
|
@ -33,9 +33,16 @@
|
|||
|
||||
/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead.
|
||||
*/
|
||||
- (void)getObjects:(id __unsafe_unretained [])objects;
|
||||
- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED;
|
||||
- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
|
||||
@property int P1;
|
||||
@property int P1 DEPRECATED;
|
||||
@property int P2 DEPRECATED;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSArray (Deprecated)
|
||||
- (void)getObjects:(id __unsafe_unretained [])objects DEPRECATED;
|
||||
- (void)dep_getObjects:(id __unsafe_unretained [])dep_objects DEPRECATED;
|
||||
@property int P1 DEPRECATED;
|
||||
@property int P2 DEPRECATED;
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue