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

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 14 05:10:01 PDT 2025


================
@@ -35,9 +35,10 @@ class DivZeroChecker : public Checker<check::PreStmt<BinaryOperator>> {
 public:
   /// This checker class implements several user facing checkers
   enum CheckKind { CK_DivideZero, CK_TaintedDivChecker, CK_NumCheckKinds };
-  bool ChecksEnabled[CK_NumCheckKinds] = {false};
-  CheckerNameRef CheckNames[CK_NumCheckKinds];
-  mutable std::unique_ptr<BugType> BugTypes[CK_NumCheckKinds];
+  BugType BugTypes[CK_NumCheckKinds] = {
+      {this, CK_DivideZero, "Division by zero"},
+      {this, CK_TaintedDivChecker, "Division by zero",
+       categories::TaintedData}};
----------------
NagyDonat wrote:

OK, I will remove the prefix -- and standardize the use of the `Checker` prefix (I don't know whether we should use it for both constants or neither, but it should be the same in both cases).

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


More information about the cfe-commits mailing list