diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-10-02 21:32:39 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-10-02 21:32:39 +0000 |
commit | 081099d302b79d1746c7a39da14e3265971eb718 (patch) | |
tree | e1148f319c2a683f3cf9853b21110d8653e6a9c6 /lib | |
parent | 2529660fe6c9c40a69dd3d71c0a511e72579eaf2 (diff) | |
download | clang-081099d302b79d1746c7a39da14e3265971eb718.tar.gz |
ObjectiveC migrator. Starting distiguising different
migrations under their own option.
wip and // rdar://15003157
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ARCMigrate/ObjCMT.cpp | 6 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 54e5662fae..a6aa4c7402 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -806,6 +806,8 @@ bool ObjCMigrateASTConsumer::migrateProperty(ASTContext &Ctx, } if (SetterMethod) { + if ((ASTMigrateActions & FrontendOptions::ObjCMT_ReadwriteProperty) == 0) + return false; if (SetterMethod->isDeprecated() || !AttributesMatch(Method, SetterMethod)) return false; @@ -1324,7 +1326,7 @@ IsReallyASystemHeader(ASTContext &Ctx, const FileEntry *file, FileID FID) { void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { TranslationUnitDecl *TU = Ctx.getTranslationUnitDecl(); - if (ASTMigrateActions & FrontendOptions::ObjCMT_Property) { + if (ASTMigrateActions & FrontendOptions::ObjCMT_MigrateDecls) { for (DeclContext::decl_iterator D = TU->decls_begin(), DEnd = TU->decls_end(); D != DEnd; ++D) { if (unsigned FID = @@ -1402,7 +1404,7 @@ ASTConsumer *MigrateSourceAction::CreateASTConsumer(CompilerInstance &CI, PPRec = new PPConditionalDirectiveRecord(CI.getSourceManager()); CI.getPreprocessor().addPPCallbacks(PPRec); return new ObjCMigrateASTConsumer(CI.getFrontendOpts().OutputFile, - FrontendOptions::ObjCMT_All, + FrontendOptions::ObjCMT_MigrateAll, Remapper, CI.getFileManager(), PPRec, diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 58a6e25d5c..3386b3fc8d 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -801,6 +801,10 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Opts.ObjCMTAction |= FrontendOptions::ObjCMT_Property; if (Args.hasArg(OPT_objcmt_migrate_readonly_property)) Opts.ObjCMTAction |= FrontendOptions::ObjCMT_ReadonlyProperty; + if (Args.hasArg(OPT_objcmt_migrate_readwrite_property)) + Opts.ObjCMTAction |= FrontendOptions::ObjCMT_ReadwriteProperty; + if (Args.hasArg(OPT_objcmt_migrate_all)) + Opts.ObjCMTAction |= FrontendOptions::ObjCMT_MigrateDecls; if (Opts.ARCMTAction != FrontendOptions::ARCMT_None && Opts.ObjCMTAction != FrontendOptions::ObjCMT_None) { |