r194709 - [objcmt] -objcmt-atomic-property & -objcmt-ns-nonatomic-iosonly are companion flags.

Argyrios Kyrtzidis akyrtzi at gmail.com
Thu Nov 14 08:33:20 PST 2013


Author: akirtzidis
Date: Thu Nov 14 10:33:20 2013
New Revision: 194709

URL: http://llvm.org/viewvc/llvm-project?rev=194709&view=rev
Log:
[objcmt] -objcmt-atomic-property & -objcmt-ns-nonatomic-iosonly are companion flags.
Ignore them when determining if some transformation was enabled.

Modified:
    cfe/trunk/lib/ARCMigrate/ObjCMT.cpp

Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=194709&r1=194708&r2=194709&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Thu Nov 14 10:33:20 2013
@@ -1710,11 +1710,15 @@ ASTConsumer *MigrateSourceAction::Create
   PPConditionalDirectiveRecord *
     PPRec = new PPConditionalDirectiveRecord(CI.getSourceManager());
   unsigned ObjCMTAction = CI.getFrontendOpts().ObjCMTAction;
-  if (ObjCMTAction == FrontendOptions::ObjCMT_None) {
+  unsigned ObjCMTOpts = ObjCMTAction;
+  // These are companion flags, they do not enable transformations.
+  ObjCMTOpts &= ~(FrontendOptions::ObjCMT_AtomicProperty |
+                  FrontendOptions::ObjCMT_NsAtomicIOSOnlyProperty);
+  if (ObjCMTOpts == FrontendOptions::ObjCMT_None) {
     // If no specific option was given, enable literals+subscripting transforms
     // by default.
-    ObjCMTAction = FrontendOptions::ObjCMT_Literals |
-                   FrontendOptions::ObjCMT_Subscripting;
+    ObjCMTAction |= FrontendOptions::ObjCMT_Literals |
+                    FrontendOptions::ObjCMT_Subscripting;
   }
   CI.getPreprocessor().addPPCallbacks(PPRec);
   return new ObjCMigrateASTConsumer(CI.getFrontendOpts().OutputFile,





More information about the cfe-commits mailing list