[clang] [clang][StaticAnalyzer] Implement per checker suppression for CSA (PR #247788)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 04:50:04 PST 2026


================
@@ -103,29 +116,28 @@ class CacheInitializer : public DynamicRecursiveASTVisitor {
 
 private:
   template <class NodeType> bool VisitAttributedNode(NodeType *Node) {
-    if (hasSuppression(Node)) {
-      // TODO: In the future, when we come up with good stable IDs for checkers
-      //       we can return a list of kinds to ignore, or all if no arguments
-      //       were provided.
-      addRange(getRange(Node));
-    }
+    for (const SuppressAttr *Suppression : getSuppressions(Node))
+      addRange(getRange(Node),
+               ArrayRef(Suppression->diagnosticIdentifiers_begin(),
+                        Suppression->diagnosticIdentifiers_end()));
----------------
steakhal wrote:

```suggestion
      addRange(getRange(Node), Suppression->diagnosticIdentifiers());
```

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


More information about the cfe-commits mailing list