diff options
Diffstat (limited to 'lib/FrontendTool')
-rw-r--r-- | lib/FrontendTool/CMakeLists.txt | 3 | ||||
-rw-r--r-- | lib/FrontendTool/ExecuteCompilerInvocation.cpp | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/FrontendTool/CMakeLists.txt b/lib/FrontendTool/CMakeLists.txt index 720ce2adf1..b8e4329c07 100644 --- a/lib/FrontendTool/CMakeLists.txt +++ b/lib/FrontendTool/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_USED_LIBS clangDriver clangFrontend clangRewrite clangCodeGen - clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers clangStaticAnalyzerCore) + clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers clangStaticAnalyzerCore + clangARCMigrate) add_clang_library(clangFrontendTool ExecuteCompilerInvocation.cpp diff --git a/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/lib/FrontendTool/ExecuteCompilerInvocation.cpp index 664b53351d..7ad263e14b 100644 --- a/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -14,6 +14,7 @@ #include "clang/FrontendTool/Utils.h" #include "clang/StaticAnalyzer/Frontend/FrontendActions.h" +#include "clang/ARCMigrate/ARCMTActions.h" #include "clang/CodeGen/CodeGenAction.h" #include "clang/Driver/CC1Options.h" #include "clang/Driver/OptTable.h" @@ -89,6 +90,21 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) { if (!Act) return 0; + // Potentially wrap the base FE action in an ARC Migrate Tool action. + switch (CI.getFrontendOpts().ARCMTAction) { + case FrontendOptions::ARCMT_None: + break; + case FrontendOptions::ARCMT_Check: + Act = new arcmt::CheckAction(Act); + break; + case FrontendOptions::ARCMT_Modify: + Act = new arcmt::TransformationAction(Act); + break; + case FrontendOptions::ARCMT_ModifyInMemory: + Act = new arcmt::InMemoryTransformationAction(Act); + break; + } + // If there are any AST files to merge, create a frontend action // adaptor to perform the merge. if (!CI.getFrontendOpts().ASTMergeFiles.empty()) |