diff options
author | John McCall <rjmccall@apple.com> | 2011-06-15 23:25:17 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-06-15 23:25:17 +0000 |
commit | 8f0e8d22960d56f8390f4971e2c0f2f0a0884602 (patch) | |
tree | 288fc5496bfa36bab70b98f3be6bb5cd13645214 /lib/Frontend/CompilerInstance.cpp | |
parent | f85e193739c953358c865005855253af4f68a497 (diff) |
The ARC Migration Tool. All the credit goes to Argyrios and Fariborz
for this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 29 |
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(); |