diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-06-16 16:17:05 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-06-16 16:17:05 +0000 |
commit | b5703510595ebf8af37e6e7a479534a01e69fccd (patch) | |
tree | 81ed2de1676bf135ac0bb06f793d192e0ecda3c3 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 8bd11f183478a5a1f18d6e42b0ea00f876c86d46 (diff) | |
download | bcm5719-llvm-b5703510595ebf8af37e6e7a479534a01e69fccd.tar.gz bcm5719-llvm-b5703510595ebf8af37e6e7a479534a01e69fccd.zip |
Raise the ARCMT functionality in Clang into proper FrontendActions.
These are somewhat special in that they wrap any other FrontendAction,
running various ARC transformations or checks prior to the standard
action's run. To implement them easily, this extends FrontendAction to
have a WrapperFrontendAction utility class which forwards all calls by
default to an inner action setup at construction time. This is then
subclassed to override the specific behavior needed by the different
ARCMT tools.
Finally, FrontendTool is taught how to create these wrapper actions from
the existing flags and options structures.
The result is that clangFrontend no longer depends on clangARCMigrate.
This is very important, as clangARCMigrate *heavily* depends on
clangFrontend. Fundamentally ARCMigrate is at the same layer as
a library like Rewrite, sitting firmly on top of the Frontend, but tied
together with the FrontendTool when building the clang binary itself.
llvm-svn: 133161
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index b05c24a9851..38fcfe3c471 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -26,7 +26,6 @@ #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" @@ -597,34 +596,6 @@ 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(); |