[clang] [NFC][analyzer] Framework for multipart checkers (PR #130985)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 14 04:24:46 PDT 2025


=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/130985 at github.com>


================
@@ -116,6 +116,19 @@ class CheckerNameRef {
   operator StringRef() const { return Name; }
 };
 
+/// A single checker class (and its singleton instance) can act as the
+/// implementation of several (user-facing or modeling) checker parts that
+/// have shared state and logic, but have their own names and can be enabled or
+/// disabled separately.
+/// Each checker class that implement multiple parts introduces its own enum
+/// type to assign small numerical indices (0, 1, 2 ...) to their parts. The
+/// type alias 'CheckerPartIdx' is conceptually the union of these enum types.
+using CheckerPartIdx = unsigned;
+
+/// If a checker doesn't have multiple parts, then its single part is
+/// represented by this index.
+constexpr CheckerPartIdx DefaultPart = 0;
----------------
steakhal wrote:

```suggestion
/// If a checker doesn't have multiple parts, then its single part is
/// represented by this index.
constexpr inline CheckerPartIdx DefaultPart = 0;
```

This is in a header, so shouldn't this have "inline" as well?

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


More information about the cfe-commits mailing list