[clang] [clang] Make serialized diagnostics more reliable (PR #100681)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 1 09:06:18 PDT 2024


jansvoboda11 wrote:

> > Could we simplify this even further by removing `DiagnosticConsumer::finish()` entirely, moving the code in `SDiagsWriter::finish()` to `SDiagsWriter::~SDiagsWriter()` and ensuring the **destructor** gets called even with `-disable-free`?
> 
> This is doable, but I'm not sure it's better. It's a bit weird to be required to destroy a single member of a member of `CompilerInstance`, but not anything else.

Ok, that's a fair point. Let's keep it as is then.

> > Also, can you please create and link a downstream PR that adds a test case?
> 
> Sure, it's just invoking the libclang dependency scanning API with an invalid driver command line.

Thanks. I'm happy to approve this PR once we have the test.

https://github.com/llvm/llvm-project/pull/100681


More information about the cfe-commits mailing list