aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-07-16 16:48:33 +0000
committerAlp Toker <alp@nuanti.com>2014-07-16 16:48:33 +0000
commit0621cb2e7dfd89f558a045f145f900b62379dcc2 (patch)
treefe7aa0e9718ccaa2199ec99044c72add529205d8 /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
parentdb829de6d6a3dd4c13b0ee75ac35e42b7b92b7e6 (diff)
downloadllvm-0621cb2e7dfd89f558a045f145f900b62379dcc2.zip
llvm-0621cb2e7dfd89f558a045f145f900b62379dcc2.tar.gz
llvm-0621cb2e7dfd89f558a045f145f900b62379dcc2.tar.bz2
Make clang's rewrite engine a core feature
The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
-rw-r--r--clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index 76baec7..de864f6 100644
--- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -45,20 +45,12 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
case DumpTokens: return new DumpTokensAction();
case EmitAssembly: return new EmitAssemblyAction();
case EmitBC: return new EmitBCAction();
-#ifdef CLANG_ENABLE_REWRITER
case EmitHTML: return new HTMLPrintAction();
-#else
- case EmitHTML: Action = "EmitHTML"; break;
-#endif
case EmitLLVM: return new EmitLLVMAction();
case EmitLLVMOnly: return new EmitLLVMOnlyAction();
case EmitCodeGenOnly: return new EmitCodeGenOnlyAction();
case EmitObj: return new EmitObjAction();
-#ifdef CLANG_ENABLE_REWRITER
case FixIt: return new FixItAction();
-#else
- case FixIt: Action = "FixIt"; break;
-#endif
case GenerateModule: return new GenerateModuleAction;
case GeneratePCH: return new GeneratePCHAction;
case GeneratePTH: return new GeneratePTHAction();
@@ -87,25 +79,17 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
case PrintDeclContext: return new DeclContextPrintAction();
case PrintPreamble: return new PrintPreambleAction();
case PrintPreprocessedInput: {
- if (CI.getPreprocessorOutputOpts().RewriteIncludes) {
-#ifdef CLANG_ENABLE_REWRITER
+ if (CI.getPreprocessorOutputOpts().RewriteIncludes)
return new RewriteIncludesAction();
-#else
- Action = "RewriteIncludesAction";
- break;
-#endif
- }
return new PrintPreprocessedAction();
}
-#ifdef CLANG_ENABLE_REWRITER
case RewriteMacros: return new RewriteMacrosAction();
- case RewriteObjC: return new RewriteObjCAction();
case RewriteTest: return new RewriteTestAction();
+#ifdef CLANG_ENABLE_OBJC_REWRITER
+ case RewriteObjC: return new RewriteObjCAction();
#else
- case RewriteMacros: Action = "RewriteMacros"; break;
case RewriteObjC: Action = "RewriteObjC"; break;
- case RewriteTest: Action = "RewriteTest"; break;
#endif
#ifdef CLANG_ENABLE_ARCMT
case MigrateSource: return new arcmt::MigrateSourceAction();
@@ -121,7 +105,7 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
}
#if !defined(CLANG_ENABLE_ARCMT) || !defined(CLANG_ENABLE_STATIC_ANALYZER) \
- || !defined(CLANG_ENABLE_REWRITER)
+ || !defined(CLANG_ENABLE_OBJC_REWRITER)
CI.getDiagnostics().Report(diag::err_fe_action_not_available) << Action;
return 0;
#else
@@ -137,11 +121,9 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
const FrontendOptions &FEOpts = CI.getFrontendOpts();
-#ifdef CLANG_ENABLE_REWRITER
if (FEOpts.FixAndRecompile) {
Act = new FixItRecompile(Act);
}
-#endif
#ifdef CLANG_ENABLE_ARCMT
if (CI.getFrontendOpts().ProgramAction != frontend::MigrateSource &&