]> granicus.if.org Git - clang/commitdiff
[arcmt] Remove '-arcmt-modify-in-memory', it turned out less useful than we hoped...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 17 Jun 2011 23:49:31 +0000 (23:49 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 17 Jun 2011 23:49:31 +0000 (23:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133315 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/ARCMigrate/ARCMT.h
include/clang/ARCMigrate/ARCMTActions.h
include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
include/clang/Frontend/FrontendOptions.h
lib/ARCMigrate/ARCMT.cpp
lib/ARCMigrate/ARCMTActions.cpp
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp
lib/FrontendTool/ExecuteCompilerInvocation.cpp

index 013f46b7d7c99b8a1675c63597d66bd42ca42ada..13f0778464a81b8cbe88d769bd81050effcbfe16 100644 (file)
@@ -41,12 +41,6 @@ bool applyTransformations(CompilerInvocation &origCI,
                           llvm::StringRef Filename, InputKind Kind,
                           DiagnosticClient *DiagClient);
 
-/// \brief Like applyTransformations but no source file is modified, compilation
-/// happens using in-memory buffers.
-bool applyTransformationsInMemory(CompilerInvocation &origCI,
-                                  llvm::StringRef Filename, InputKind Kind,
-                                  DiagnosticClient *DiagClient);
-
 typedef void (*TransformFn)(MigrationPass &pass);
 
 std::vector<TransformFn> getAllTransformations();
index d2d9410b32f8f9c01e00b5b0d2eee6d9b5b2d784..2dd57ab88bef5b4a22bf81bc0214bef96fb30e5d 100644 (file)
@@ -32,14 +32,6 @@ public:
   TransformationAction(FrontendAction *WrappedAction);
 };
 
-class InMemoryTransformationAction : public WrapperFrontendAction {
-protected:
-  virtual void ExecuteAction();
-
-public:
-  InMemoryTransformationAction(FrontendAction *WrappedAction);
-};
-
 }
 }
 
index cc594085ffa0b2db2b6843d82545177837a15d97..029c331973e4d6806e3e65a96cb08bf01a09f7bc 100644 (file)
@@ -387,8 +387,6 @@ def arcmt_check : Flag<"-arcmt-check">,
   HelpText<"Check for ARC migration issues that need manual handling">;
 def arcmt_modify : Flag<"-arcmt-modify">,
   HelpText<"Apply modifications to files to conform to ARC">;
-def arcmt_modify_in_memory : Flag<"-arcmt-modify-in-memory">,
-  HelpText<"Apply ARC conforming modifications & compile using memory buffers">;
 
 def import_module : Separate<"-import-module">,
   HelpText<"Import a module definition file">;
index 6b2af9550076c6a39f89a8eb4290acad55bd825f..6f62489634edd47156bb3ef12e961d235b07af84 100644 (file)
@@ -116,8 +116,6 @@ def ccc_arrmt_check : Flag<"-ccc-arrmt-check">, CCCDriverOpt,
   HelpText<"Check for ARC migration issues that need manual handling">;
 def ccc_arrmt_modify : Flag<"-ccc-arrmt-modify">, CCCDriverOpt,
   HelpText<"Apply modifications to files to conform to ARC">;
-def ccc_arrmt_modify_in_memory : Flag<"-ccc-arrmt-modify-in-memory">,
-  HelpText<"Apply ARC conforming modifications & compile using memory buffers">;
 
 // Make sure all other -ccc- options are rejected.
 def ccc_ : Joined<"-ccc-">, Group<ccc_Group>, Flags<[Unsupported]>;
index e97be26a6433b55435e91dd01268f95103362912..18117e965862202c3b4830aa793f815d5f018a0c 100644 (file)
@@ -80,8 +80,7 @@ public:
   enum {
     ARCMT_None,
     ARCMT_Check,
-    ARCMT_Modify,
-    ARCMT_ModifyInMemory
+    ARCMT_Modify
   } ARCMTAction;
 
   /// The input files and their types.
index 98e593c0fa638bf9c07ed4ef1291aab4868c34c9..04c35e28c89efca211e0ce996c8270163f9d8756 100644 (file)
@@ -276,41 +276,6 @@ bool arcmt::applyTransformations(CompilerInvocation &origCI,
   return migration.getRemapper().overwriteOriginal(*Diags);
 }
 
-//===----------------------------------------------------------------------===//
-// applyTransformationsInMemory.
-//===----------------------------------------------------------------------===//
-
-bool arcmt::applyTransformationsInMemory(CompilerInvocation &origCI,
-                                       llvm::StringRef Filename, InputKind Kind,
-                                       DiagnosticClient *DiagClient) {
-  if (!origCI.getLangOpts().ObjC1)
-    return false;
-
-  // Make sure checking is successful first.
-  CompilerInvocation CInvokForCheck(origCI);
-  if (arcmt::checkForManualIssues(CInvokForCheck, Filename, Kind, DiagClient))
-    return true;
-
-  CompilerInvocation CInvok(origCI);
-  CInvok.getFrontendOpts().Inputs.clear();
-  CInvok.getFrontendOpts().Inputs.push_back(std::make_pair(Kind, Filename));
-  
-  MigrationProcess migration(CInvok, DiagClient);
-
-  std::vector<TransformFn> transforms = arcmt::getAllTransformations();
-  assert(!transforms.empty());
-
-  for (unsigned i=0, e = transforms.size(); i != e; ++i) {
-    bool err = migration.applyTransform(transforms[i]);
-    if (err) return true;
-  }
-
-  origCI.getLangOpts().ObjCAutoRefCount = true;
-  migration.getRemapper().transferMappingsAndClear(origCI);
-
-  return false;
-}
-
 //===----------------------------------------------------------------------===//
 // CollectTransformActions.
 //===----------------------------------------------------------------------===//
index a30c2783e3e2cbabee8c89156057411abb0c836c..4da928a0ebf331e765959f9e82ee5e47fd36f987 100644 (file)
@@ -41,18 +41,3 @@ void TransformationAction::ExecuteAction() {
 
 TransformationAction::TransformationAction(FrontendAction *WrappedAction)
   : WrapperFrontendAction(WrappedAction) {}
-
-void InMemoryTransformationAction::ExecuteAction() {
-  CompilerInstance &CI = getCompilerInstance();
-  if (arcmt::applyTransformationsInMemory(CI.getInvocation(), getCurrentFile(),
-                                          getCurrentFileKind(),
-                                          CI.getDiagnostics().getClient()))
-    return;
-
-  WrapperFrontendAction::ExecuteAction();
-}
-
-InMemoryTransformationAction::InMemoryTransformationAction(
-    FrontendAction *WrappedAction)
-  : WrapperFrontendAction(WrappedAction) {}
-
index b72f12abdea59196fa76b79e297c42733506fbbe..804094ba53f8cf19729c7cc9460a28449a07d936 100644 (file)
@@ -1391,8 +1391,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
   if (!Args.hasArg(options::OPT_fno_objc_arc)) {
     if (const Arg *A = Args.getLastArg(options::OPT_ccc_arrmt_check,
-                                       options::OPT_ccc_arrmt_modify,
-                                       options::OPT_ccc_arrmt_modify_in_memory)) {
+                                       options::OPT_ccc_arrmt_modify)) {
       switch (A->getOption().getID()) {
       default:
         llvm_unreachable("missed a case");
@@ -1402,9 +1401,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
       case options::OPT_ccc_arrmt_modify:
         CmdArgs.push_back("-arcmt-modify");
         break;
-      case options::OPT_ccc_arrmt_modify_in_memory:
-        CmdArgs.push_back("-arcmt-modify-in-memory");
-        break;
       }
     }
   }
index 2c158fb1e4cb6b95ad7864e32550d534954d2ec4..c9718c4d881b2cdca8cf4688995008df4c037464 100644 (file)
@@ -424,9 +424,6 @@ static void FrontendOptsToArgs(const FrontendOptions &Opts,
   case FrontendOptions::ARCMT_Modify:
     Res.push_back("-arcmt-modify");
     break;
-  case FrontendOptions::ARCMT_ModifyInMemory:
-    Res.push_back("-arcmt-modify-in-memory");
-    break;
   }
 
   bool NeedLang = false;
@@ -1242,8 +1239,7 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
 
   Opts.ARCMTAction = FrontendOptions::ARCMT_None;
   if (const Arg *A = Args.getLastArg(OPT_arcmt_check,
-                                     OPT_arcmt_modify,
-                                     OPT_arcmt_modify_in_memory)) {
+                                     OPT_arcmt_modify)) {
     switch (A->getOption().getID()) {
     default:
       llvm_unreachable("missed a case");
@@ -1253,9 +1249,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
     case OPT_arcmt_modify:
       Opts.ARCMTAction = FrontendOptions::ARCMT_Modify;
       break;
-    case OPT_arcmt_modify_in_memory:
-      Opts.ARCMTAction = FrontendOptions::ARCMT_ModifyInMemory;
-      break;
     }
   }
 
index 7ad263e14b8cc66915eb347d1597947ebc3f290c..eb1c208df18b92b4b3582a645859be7e39c0b5ba 100644 (file)
@@ -100,9 +100,6 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
   case FrontendOptions::ARCMT_Modify:
     Act = new arcmt::TransformationAction(Act);
     break;
-  case FrontendOptions::ARCMT_ModifyInMemory:
-    Act = new arcmt::InMemoryTransformationAction(Act);
-    break;
   }
 
   // If there are any AST files to merge, create a frontend action