[PATCH] Driver: Include driver diags when we --serialize-diagnostics

Richard Smith richard at metafoo.co.uk
Mon Oct 20 14:30:48 PDT 2014

On Mon, Oct 20, 2014 at 10:43 AM, Justin Bogner <mail at justinbogner.com>

> 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.
> This patch handles this by merging the diagnostics from the CC1 process
> and the driver diagnostics into a single file when the driver invokes
> CC1.

The idea seems (superficially) reasonable to me. Have you tested this in
the case where the driver is given multiple input files to process? Please
add a test covering that case.

What about the case where the clang driver runs a tool other than the clang
frontend? Your hypothetical process that runs clang with
--serialize-diagnostics and drops its stderr will lose diagnostics there
too, right?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141020/4812c642/attachment.html>

More information about the cfe-commits mailing list