[clang] [clang] Make documentation warnings faster with --warning-suppression-mappings= (PR #244714)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 02:35:37 PST 2026


================
@@ -2806,10 +2806,29 @@ void Sema::clearDocumentationDiagsCache() {
   DocDiagsExactComputed = 0;
 }
 
+bool Sema::areDocumentationDiagsSourceLocationDependent() {
+  // Documentation diagnostics are not location-dependent, except if a
+  // (location-dependent) warning suppression mapping is active.
+  if (!DocDiagsInSuppressionMapping) {
+    if (Diags.hasDiagSuppressionMapping()) {
+      SmallVector<diag::kind, 64> DocDiags;
+      for (StringRef Group : {"documentation", "documentation-pedantic"})
----------------
zmodem wrote:

Can these get out-of-sync with the group names and other parts of the code? Is there some more symbolic way to refer to them, how does other code do it?

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


More information about the cfe-commits mailing list