[cfe-commits] r149001 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/MigratorOptions.h lib/ARCMigrate/ARCMT.cpp lib/ARCMigrate/Internals.h

Fariborz Jahanian fjahanian at apple.com
Wed Jan 25 16:08:04 PST 2012


Author: fjahanian
Date: Wed Jan 25 18:08:04 2012
New Revision: 149001

URL: http://llvm.org/viewvc/llvm-project?rev=149001&view=rev
Log:
arc migrator: Added an option to the migrator
unused yet.

Modified:
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/include/clang/Frontend/MigratorOptions.h
    cfe/trunk/lib/ARCMigrate/ARCMT.cpp
    cfe/trunk/lib/ARCMigrate/Internals.h

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=149001&r1=149000&r2=149001&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Wed Jan 25 18:08:04 2012
@@ -106,6 +106,9 @@
 def migrator_no_nsalloc_error : Flag<"-no-ns-alloc-error">,
   HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">;
 
+def migrator_no_finalize_removal : Flag<"-no-finalize-removal">,
+  HelpText<"Do not remove finalize method in gc mode">;
+
 //===----------------------------------------------------------------------===//
 // CodeGen Options
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/include/clang/Frontend/MigratorOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/MigratorOptions.h?rev=149001&r1=149000&r2=149001&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/MigratorOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/MigratorOptions.h Wed Jan 25 18:08:04 2012
@@ -20,8 +20,10 @@
 class MigratorOptions {
 public:
   unsigned NoNSAllocReallocError : 1;
+  unsigned NoFinalizeRemoval : 1;
   MigratorOptions() {
     NoNSAllocReallocError = 0;
+    NoFinalizeRemoval = 0;
   }
 };
 

Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=149001&r1=149000&r2=149001&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Wed Jan 25 18:08:04 2012
@@ -230,6 +230,7 @@
 
   LangOptions::GCMode OrigGCMode = origCI.getLangOpts()->getGC();
   bool NoNSAllocReallocError = origCI.getMigratorOpts().NoNSAllocReallocError;
+  bool NoFinalizeRemoval = origCI.getMigratorOpts().NoFinalizeRemoval;
 
   std::vector<TransformFn> transforms = arcmt::getAllTransformations(OrigGCMode);
   assert(!transforms.empty());
@@ -294,6 +295,7 @@
   TransformActions testAct(*Diags, capturedDiags, Ctx, Unit->getPreprocessor());
   MigrationPass pass(Ctx, OrigGCMode, Unit->getSema(), testAct, ARCMTMacroLocs);
   pass.setNSAllocReallocError(NoNSAllocReallocError);
+  pass.setNoFinalizeRemoval(NoFinalizeRemoval);
 
   for (unsigned i=0, e = transforms.size(); i != e; ++i)
     transforms[i](pass);

Modified: cfe/trunk/lib/ARCMigrate/Internals.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/Internals.h?rev=149001&r1=149000&r2=149001&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/Internals.h (original)
+++ cfe/trunk/lib/ARCMigrate/Internals.h Wed Jan 25 18:08:04 2012
@@ -155,6 +155,8 @@
   bool isGCMigration() const { return OrigGCMode != LangOptions::NonGC; }
   bool noNSAllocReallocError() const { return MigOptions.NoNSAllocReallocError; }
   void setNSAllocReallocError(bool val) { MigOptions.NoNSAllocReallocError = val; }
+  bool noFinalizeRemoval() const { return MigOptions.NoFinalizeRemoval; }
+  void setNoFinalizeRemoval(bool val) {MigOptions.NoFinalizeRemoval = val; }
 };
 
 static inline StringRef getARCMTMacroName() {





More information about the cfe-commits mailing list