From 5a6a2fcdeef3f51d98183cb5d737facf91718a4b Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Thu, 23 Oct 2014 22:20:11 +0000 Subject: 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/lib/Frontend/CompilerInstance.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') 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(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( -- cgit v1.2.3