diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-10-23 22:20:11 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-10-23 22:20:11 +0000 |
commit | 5a6a2fcdeef3f51d98183cb5d737facf91718a4b (patch) | |
tree | ded5a5ad19666faf2fa3766727ea474c6be924a8 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | a182530633c46ef772bb346eca16b471b591c899 (diff) | |
download | bcm5719-llvm-5a6a2fcdeef3f51d98183cb5d737facf91718a4b.tar.gz bcm5719-llvm-5a6a2fcdeef3f51d98183cb5d737facf91718a4b.zip |
Driver: Include driver diagnostics when we --serialize-diagnostics
Currently, when --serialize-diagnostics is passed this only includes
the diagnostics from clang -cc1, and driver diagnostics are
dropped. This causes issues for tools that use the serialized
diagnostics, since stderr is lost and these diagnostics aren't seen at
all.
We handle this by merging the diagnostics from the CC1 process and the
driver diagnostics into a single file when the driver invokes CC1.
Fixes rdar://problem/10585062
llvm-svn: 220525
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 9bf14c791bb..4563d2a409a 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -612,8 +612,9 @@ bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args, bool Success = true; Opts.DiagnosticLogFile = Args.getLastArgValue(OPT_diagnostic_log_file); - Opts.DiagnosticSerializationFile = - Args.getLastArgValue(OPT_diagnostic_serialized_file); + if (Arg *A = + Args.getLastArg(OPT_diagnostic_serialized_file, OPT__serialize_diags)) + Opts.DiagnosticSerializationFile = A->getValue(); Opts.IgnoreWarnings = Args.hasArg(OPT_w); Opts.NoRewriteMacros = Args.hasArg(OPT_Wno_rewrite_macros); Opts.Pedantic = Args.hasArg(OPT_pedantic); |