[clang] [analyzer] Conversion to CheckerFamily: MallocChecker (PR #147080)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 7 08:09:44 PDT 2025


================
@@ -3902,16 +3846,15 @@ void MallocChecker::printState(raw_ostream &Out, ProgramStateRef State,
     for (auto [Sym, Data] : RS) {
       const RefState *RefS = State->get<RegionState>(Sym);
       AllocationFamily Family = RefS->getAllocationFamily();
-      std::optional<MallocChecker::CheckKind> CheckKind =
-          getCheckIfTracked(Family);
-      if (!CheckKind)
-        CheckKind = getCheckIfTracked(Family, true);
+
+      const CheckerFrontend *Frontend =
+          getRelevantFrontendAs<CheckerFrontend>(Family);
 
       Sym->dumpToStream(Out);
       Out << " : ";
       Data.dump(Out);
-      if (CheckKind)
-        Out << " (" << CheckNames[*CheckKind] << ")";
+      if (Frontend)
----------------
NagyDonat wrote:

```suggestion
      if (Frontend && Frontend.isEnabled())
```

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


More information about the cfe-commits mailing list