summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2018-05-31 13:57:09 +0000
committerAaron Ballman <aaron@aaronballman.com>2018-05-31 13:57:09 +0000
commit16ed8dd823a4c2282425d081e1817d9dc205775e (patch)
tree010f16011621b4b3d51b0408ea6e0c7b5c521d01 /clang/lib/Frontend/CompilerInvocation.cpp
parentd657c2564980cb4ad763c49bf5181c1311824085 (diff)
downloadbcm5719-llvm-16ed8dd823a4c2282425d081e1817d9dc205775e.tar.gz
bcm5719-llvm-16ed8dd823a4c2282425d081e1817d9dc205775e.zip
Add a new driver mode to dump compiler feature and extension options.
Add the ability to dump compiler option-related information to a JSON file via the -compiler-options-dump option. Specifically, it dumps the features/extensions lists -- however, this output could be extended to other information should it be useful. In order to support features and extensions, I moved them into a .def file so that we could build the various lists we care about from them without a significant increase in maintenance burden. llvm-svn: 333653
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 594164332ec..b5396dd758f 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1396,6 +1396,8 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Opts.ProgramAction = frontend::ASTPrint; break;
case OPT_ast_view:
Opts.ProgramAction = frontend::ASTView; break;
+ case OPT_compiler_options_dump:
+ Opts.ProgramAction = frontend::DumpCompilerOptions; break;
case OPT_dump_raw_tokens:
Opts.ProgramAction = frontend::DumpRawTokens; break;
case OPT_dump_tokens:
@@ -2788,6 +2790,7 @@ static bool isStrictlyPreprocessorAction(frontend::ActionKind Action) {
case frontend::MigrateSource:
return false;
+ case frontend::DumpCompilerOptions:
case frontend::DumpRawTokens:
case frontend::DumpTokens:
case frontend::InitOnly:
OpenPOWER on IntegriCloud