]> granicus.if.org Git - clang/commitdiff
[objcmt] If no objcmt options were specified, default to enable literals+subscripting.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 13 Nov 2013 23:38:22 +0000 (23:38 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 13 Nov 2013 23:38:22 +0000 (23:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194629 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ARCMigrate/ObjCMT.cpp

index b5f6585355a38da8b4b1c75542764fe162148326..b10f060d5f6d8ff2cec32cbd971146238c48665a 100644 (file)
@@ -1709,9 +1709,16 @@ ASTConsumer *MigrateSourceAction::CreateASTConsumer(CompilerInstance &CI,
                                                   StringRef InFile) {
   PPConditionalDirectiveRecord *
     PPRec = new PPConditionalDirectiveRecord(CI.getSourceManager());
+  unsigned ObjCMTAction = CI.getFrontendOpts().ObjCMTAction;
+  if (ObjCMTAction == FrontendOptions::ObjCMT_None) {
+    // If no specific option was given, enable literals+subscripting transforms
+    // by default.
+    ObjCMTAction = FrontendOptions::ObjCMT_Literals |
+                   FrontendOptions::ObjCMT_Subscripting;
+  }
   CI.getPreprocessor().addPPCallbacks(PPRec);
   return new ObjCMigrateASTConsumer(CI.getFrontendOpts().OutputFile,
-                                    CI.getFrontendOpts().ObjCMTAction,
+                                    ObjCMTAction,
                                     Remapper,
                                     CI.getFileManager(),
                                     PPRec,