diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-11-11 00:07:43 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-11-11 00:07:43 +0000 |
commit | e73d9ed1a281140a1116e49d15915cd8a20747b8 (patch) | |
tree | e28623d59243efddadc5aff04fd1bd3dff07be07 /clang | |
parent | d9a9be269c88ef2bc449b14250eab2bb4549378f (diff) | |
download | bcm5719-llvm-e73d9ed1a281140a1116e49d15915cd8a20747b8.tar.gz bcm5719-llvm-e73d9ed1a281140a1116e49d15915cd8a20747b8.zip |
Add top-level driver option '--serialize-diagnostics' for serialize compiler diagnostics to a file.
llvm-svn: 144339
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Driver/CC1Options.td | 2 | ||||
-rw-r--r-- | clang/include/clang/Driver/Options.td | 2 | ||||
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td index e8d06f994fd..882805bc2fc 100644 --- a/clang/include/clang/Driver/CC1Options.td +++ b/clang/include/clang/Driver/CC1Options.td @@ -232,7 +232,7 @@ def dump_build_information : Separate<"-dump-build-information">, HelpText<"output a dump of some build information to a file">; def diagnostic_log_file : Separate<"-diagnostic-log-file">, HelpText<"Filename (or -) to log diagnostics to">; -def diagnostic_serialized_file : Separate<"-diagnostic-serialized-file">, +def diagnostic_serialized_file : Separate<"-serialize-diagnostic-file">, MetaVarName<"<filename>">, HelpText<"File for serializing diagnostics in a binary format">; def fno_show_column : Flag<"-fno-show-column">, diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 68d132dc17e..1e2274a8b7a 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -846,6 +846,8 @@ def _relocatable_pch : Flag<"--relocatable-pch">, def _resource_EQ : Joined<"--resource=">, Alias<fcompile_resource_EQ>; def _resource : Separate<"--resource">, Alias<fcompile_resource_EQ>; def _save_temps : Flag<"--save-temps">, Alias<save_temps>; +def _serialize_diags : Separate<"--serialize-diagnostics">, Flags<[DriverOption]>, + HelpText<"Serialize compiler diagnostics to a file">; def _shared : Flag<"--shared">, Alias<shared>; def _signed_char : Flag<"--signed-char">, Alias<fsigned_char>; def _specs_EQ : Joined<"--specs=">, Alias<specs_EQ>; diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 6576fcae3e4..9faac7174ac 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -2213,6 +2213,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_dM); Args.AddLastArg(CmdArgs, options::OPT_dD); + + // Handle serialized diagnostics. + if (Arg *A = Args.getLastArg(options::OPT__serialize_diags)) { + CmdArgs.push_back("-serialize-diagnostic-file"); + CmdArgs.push_back(Args.MakeArgString(A->getValue(Args))); + } // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option // parser. |