summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-06-15 23:25:17 +0000
committerJohn McCall <rjmccall@apple.com>2011-06-15 23:25:17 +0000
commitd70fb9812adbfa133be0c4348faa014c4f53f1c5 (patch)
treee958f99ebbd6548f7e4c242202643f3f986c36c7 /clang/lib/Frontend/CompilerInstance.cpp
parent31168b077c3687bb79985102b08718cd77db353d (diff)
downloadbcm5719-llvm-d70fb9812adbfa133be0c4348faa014c4f53f1c5.tar.gz
bcm5719-llvm-d70fb9812adbfa133be0c4348faa014c4f53f1c5.zip
The ARC Migration Tool. All the credit goes to Argyrios and Fariborz
for this. llvm-svn: 133104
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 38fcfe3c471..b05c24a9851 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();
OpenPOWER on IntegriCloud