diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 29 | 
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 38fcfe3..b05c24a 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -26,6 +26,7 @@  #include "clang/Frontend/TextDiagnosticPrinter.h"  #include "clang/Frontend/VerifyDiagnosticsClient.h"  #include "clang/Frontend/Utils.h" +#include "clang/ARCMigrate/ARCMT.h"  #include "clang/Serialization/ASTReader.h"  #include "clang/Sema/CodeCompleteConsumer.h"  #include "llvm/Support/FileSystem.h" @@ -596,6 +597,34 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {      if (hasSourceManager())        getSourceManager().clearIDTables(); +    switch (getFrontendOpts().ARCMTAction) { +    default: +      break; + +    case FrontendOptions::ARCMT_Check: +      if (arcmt::checkForManualIssues(getInvocation(), InFile, +                                      getFrontendOpts().Inputs[i].first, +                                      getDiagnostics().getClient())) +        continue; +      // We only want to see warnings reported from arcmt::checkForManualIssues. +      getDiagnostics().setIgnoreAllWarnings(true); +      break; + +    case FrontendOptions::ARCMT_Modify: +      if (arcmt::applyTransformations(getInvocation(), InFile, +                                      getFrontendOpts().Inputs[i].first, +                                      getDiagnostics().getClient())) +        continue; +      break; + +    case FrontendOptions::ARCMT_ModifyInMemory: +      if (arcmt::applyTransformationsInMemory(getInvocation(), InFile, +                                              getFrontendOpts().Inputs[i].first, +                                              getDiagnostics().getClient())) +        continue; +      break; +    } +      if (Act.BeginSourceFile(*this, InFile, getFrontendOpts().Inputs[i].first)) {        Act.Execute();        Act.EndSourceFile();  | 
