Driver: Include driver diagnostics when we --serialize-diagnostics
authorJustin Bogner <mail@justinbogner.com>
Thu, 23 Oct 2014 22:20:11 +0000 (22:20 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 23 Oct 2014 22:20:11 +0000 (22:20 +0000)
commit5a6a2fcdeef3f51d98183cb5d737facf91718a4b
treeded5a5ad19666faf2fa3766727ea474c6be924a8
parenta182530633c46ef772bb346eca16b471b591c899
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
clang/include/clang/Basic/DiagnosticFrontendKinds.td
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Frontend/SerializedDiagnosticPrinter.h
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
clang/test/Misc/serialized-diags-driver.c [new file with mode: 0644]
clang/tools/driver/driver.cpp