[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)
kadir çetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 29 06:16:15 PDT 2024
================
@@ -946,6 +953,24 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
return (Level)Diags->getDiagnosticLevel(DiagID, Loc, *this);
}
+ /// Diagnostic suppression mappings can be used to ignore diagnostics based on
+ /// the file they occur in. Mapping file is expected to be a special case list
+ /// with sections denoting diagnostic groups and `src` entries for globs to
+ /// suppress. `emit` category can be used to disable suppression. Longest glob
+ /// that matches a filepath takes precendence. For example:
+ /// [unused]
+ /// src:*clang/*
+ /// src:*clang/foo/*=emit
+ /// src:*clang/foo/bar/*
+ ///
+ /// Such a mappings file suppress all diagnostics produced by -Wunused in all
+ /// sources under `clang/` directory apart from `clang/foo/`. Diagnostics
----------------
kadircet wrote:
fair point updated the comment.
https://github.com/llvm/llvm-project/pull/112517
More information about the cfe-commits
mailing list