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/CompilerInstance.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/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index ba0743abd26..1f336b48e29 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -167,18 +167,8 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts, static void SetupSerializedDiagnostics(DiagnosticOptions *DiagOpts, DiagnosticsEngine &Diags, StringRef OutputFile) { - std::error_code EC; - auto OS = llvm::make_unique<llvm::raw_fd_ostream>(OutputFile.str(), EC, - llvm::sys::fs::F_None); - - if (EC) { - Diags.Report(diag::warn_fe_serialized_diag_failure) << OutputFile - << EC.message(); - return; - } - auto SerializedConsumer = - clang::serialized_diags::create(std::move(OS), DiagOpts); + clang::serialized_diags::create(OutputFile, DiagOpts); assert(Diags.ownsClient()); Diags.setClient(new ChainedDiagnosticConsumer( |