[cfe-dev] diagnostics database for multi-file build?

Samuel Williams space.ship.traveller at gmail.com
Tue Feb 24 15:48:11 PST 2015


Hi Csaba, thanks for the quick reply.

I have a build system which builds multiple files concurrently.

Because of this, the diagnostics get interleaved and it is hard to
understand the output.

Additionally, I'd like to machine parse the diagnostics by a plugin to atom
text editor so I can highlight lines, present a useful list of errors,
provide navigation, etc.

What you've suggest looks good if you can invoke clang just once, or if you
invoke it multiple times, collect all the output and then merge it
together. I was hoping there might be a simple solution, e.g.

rm database.sqlite3
clang -c foo.c --diagnostic-database=database.sqlite3
clang -c bar.c --diagnostic-database=database.sqlite3
clang -c baz.c --diagnostic-database=database.sqlite3

The finally I could inspect database.sqlite3 to see a list of all
diagnostics. Ideally, you'd still get the PTY colourized output too - the
database would be an additional option to coalesce unique errors over a
large code-base and give a structured format for understanding the
diagnostics that could be processed by an editor or other tool.

Ideally this would be an open standard, e.g. this line, this character
range, and could be used across multiple tools, e.g. gcc, python, ruby, etc.

On 25 February 2015 at 10:13, Csaba Raduly <rcsaba at gmail.com> wrote:

> Hi Samuel,
>
> What do you mean by "unique"? Do you mean something like
>
> clang -Wall -pedantic -Wextra -c *.c | perl -pwle
> 's/^\S+?:(\d+:)?(\d+:)?\s*//'  | sort | uniq -c
>
> On Tue, Feb 24, 2015 at 2:21 PM, Samuel Williams  wrote:
> > I'm interested in a way to collect unique errors/diagnostics over
> multiple
> > files in a single build. Does such a thing exist? e.g. some kind of
> database
> > that could be shared between multiple concurrent instances of clang which
> > would allow me to review all unique errors across an entire code base,
> > ideally in real time but perhaps once the build completes would be okay
> to
> > start with too. Thanks.
>
> Csaba
> --
> GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
> The Tao of math: The numbers you can count are not the real numbers.
> Life is complex, with real and imaginary parts.
> "Ok, it boots. Which means it must be bug-free and perfect. " -- Linus
> Torvalds
> "People disagree with me. I just ignore them." -- Linus Torvalds
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150225/602e7b36/attachment.html>


More information about the cfe-dev mailing list