[PATCH] D48116: [libclang] Allow skipping warnings from all included files

Nikolai Kosjar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 19 00:06:49 PST 2019


nik added a comment.
Herald added a project: clang.

>> For filtering in StoredDiagnosticConsumer one needs to pass the new bool everywhere along where "bool CaptureDiagnostics" is already passed on (to end up in the StoredDiagnosticConsumer constructor) . Also, ASTUnit::CaptureDiagnostics is then not enough anymore since the new bool is also needed in getMainBufferWithPrecompiledPreamble(). One could also (2) convert  "bool CaptureDiagnostics" to an enum with enumerators like CaptureNothing, CaptureAll, CaptureAllWithoutNonErrorsFromIncludes to make this a bit less invasive.
>>  If changing clang's diagnostic interface should be avoided, I tend to go with (2). Ilya?
> 
> Yeah, LG. The changes in the `ASTUnit` look strictly better than changes in clang - the latter seems to already provide enough to do the filtering.
>  If you avoid changing the `StoredDiagnosticConsumer` (or writing a filtering wrapper for `DiagnosticConsumer`), you'll end up having some diagnostics inside headers generated **after** preamble was built, right?

If there is some #include after the first declaration, possibly. Why is that relevant?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D48116/new/

https://reviews.llvm.org/D48116





More information about the cfe-commits mailing list