[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 03:45:13 PDT 2024


================
@@ -477,6 +485,100 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor,
       setSeverity(Diag, Map, Loc);
 }
 
+namespace {
+class WarningsSpecialCaseList : public llvm::SpecialCaseList {
----------------
kadircet wrote:

unfortunately we need to use inheritance, as we need access to internals for implemeting some custom "special-case-list" matching logic.

current users of `SpecialCaseList` also go with a similar approach for adding some custom support on top of the parser. I don't feel comfortable changing/exposing all these interfaces directly from `SpecialCaseList`. Especially because it has some backward-compatibility gurantees around regexes vs globs etc, and I don't want to carry that complexity into this new use case.

I think in an ideal world `SpecialCaseList` should just expose its parser, and we'd use it here. I can perform such a refactoring if you feel strong about this.

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


More information about the cfe-commits mailing list