================
@@ -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 would like to preserve that `CheckerFrontendWithBugType` is a transparent 
lightweight composition of the two classes, so I'd prefer deriving from 
`BugType` because that way `PathSensitiveBugReport` doesn't need to know that 
`CheckerFrontendWithBugType`  exists.

Anyway, this "magic" is not too unusual in C++ code and I don't think that it 
would cause confusion so I'll implement it.

https://github.com/llvm/llvm-project/pull/139256
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to