aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 38fcfe3c47..b05c24a985 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/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();