[clang] [analyzer][NFC] Introduce framework for checker families (PR #139256)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Tue May 13 05:31:52 PDT 2025
================
@@ -56,11 +54,11 @@ static const Expr *getDenomExpr(const ExplodedNode *N) {
void DivZeroChecker::reportBug(StringRef Msg, ProgramStateRef StateZero,
CheckerContext &C) const {
- if (!isPartEnabled(DivideZeroChecker))
+ if (!DivideZeroChecker.isEnabled())
return;
if (ExplodedNode *N = C.generateErrorNode(StateZero)) {
- auto R = std::make_unique<PathSensitiveBugReport>(
- BugTypes[DivideZeroChecker], Msg, N);
+ auto R = std::make_unique<PathSensitiveBugReport>(DivideZeroChecker.getBT(),
+ Msg, N);
----------------
NagyDonat wrote:
I felt that this implicit conversion would be a bit "too magical", but it would be _very_ easy to declare that `CheckerFrontendWithBugType` derives from both `CheckerFrontend` and `BugType`, and I'm not opposed if you prefer it.
https://github.com/llvm/llvm-project/pull/139256
More information about the cfe-commits
mailing list