)]}'
{
  "commit": "6833076a5d9f5719539a24e900037da5a3979289",
  "tree": "d8644e1eae459857be5bf118707a0e3a1711b222",
  "parents": [
    "3033f202f6707937cd28c2473479db134993f96f"
  ],
  "author": {
    "name": "Donát Nagy",
    "email": "donat.nagy@ericsson.com",
    "time": "Mon May 26 20:27:42 2025 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon May 26 20:27:42 2025 +0200"
  },
  "message": "[analyzer][NFC] Introduce framework for checker families (#139256)\n\nThe checker classes (i.e. classes derived from `CheckerBase` via the\nutility template `Checker\u003c...\u003e`) act as intermediates between the user\nand the analyzer engine, so they have two interfaces:\n- On the frontend side, they have a public name, can be enabled or\ndisabled, can accept checker options and can be reported as the source\nof bug reports.\n- On the backend side, they can handle various checker callbacks and\nthey \"leave a mark\" on the `ExplodedNode`s that are created by them.\n(These `ProgramPointTag` marks are internal: they appear in debug logs\nand can be queried by checker logic; but the user doesn\u0027t see them.)\n\nIn a significant majority of the checkers there is 1:1 correspondence\nbetween these sides, but there are also many checker classes where\nseveral related user-facing checkers share the same backend class.\nHistorically each of these \"multi-part checker\" classes had its own\nhacks to juggle its multiple names, which led to lots of ugliness like\nlazy initialization of `mutable std::unique_ptr\u003cBugType\u003e` members and\nredundant data members (when a checker used its custom `CheckNames`\narray and ignored the inherited single `Name`).\n\nMy recent commit 27099982da2f5a6c2d282d6b385e79d080669546 tried to unify\nand standardize these existing solutions to get rid of some of the\ntechnical debt, but it still used enum values to identify the checker\nparts within a \"multi-part\" checker class, which led to some ugliness.\n\nThis commit introduces a new framework which takes a more direct,\nobject-oriented approach: instead of identifying checker parts with\n`{parent checker object, index of part}` pairs, the parts of a\nmulti-part checker become stand-alone objects that store their own name\n(and enabled/disabled status) as a data member.\n\nThis is implemented by separating the functionality of `CheckerBase`\ninto two new classes: `CheckerFrontend` and `CheckerBackend`. The name\n`CheckerBase` is kept (as a class derived from both `CheckerFrontend`\nand `CheckerBackend`), so \"simple\" checkers that use `CheckerBase` and\n`Checker\u003c...\u003e` continues to work without changes. However we also get\nfirst-class support for the \"many frontends - one backend\" situation:\n- The class `CheckerFamily\u003c...\u003e` works exactly like `Checker\u003c...\u003e` but\ninherits from `CheckerBackend` instead of `CheckerBase`, so it won\u0027t\nhave a superfluous single `Name` member.\n- Classes deriving from `CheckerFamily` can freely own multiple\n`CheckerFrontend` data members, which are enabled within the\nregistration methods corresponding to their name and can be used to\ninitialize the `BugType`s that they can emit.\n\nIn this scheme each `CheckerFamily` needs to override the pure virtual\nmethod `ProgramPointTag::getTagDescription()` which returns a string\nwhich represents that class for debugging purposes. (Previously this\nused the name of one arbitrary sub-checker, which was passable for\ndebugging purposes, but not too elegant.)\n\nI\u0027m planning to implement follow-up commits that convert all the\n\"multi-part\" checkers to this `CheckerFamily` framework.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "096ad48a429844060684a69f79b6586fcbf19e60",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Analysis/ProgramPoint.h",
      "new_id": "b06d38baf4643a96c0f846a0e5c114e29224f7b9",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Analysis/ProgramPoint.h"
    },
    {
      "type": "modify",
      "old_id": "8e1d25b3eefa1fe1b74183e82e3f96f0758bcaea",
      "old_mode": 33188,
      "old_path": "clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h",
      "new_id": "33d37febc7327292610e7b73b604ef2ef4fab61b",
      "new_mode": 33188,
      "new_path": "clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
    },
    {
      "type": "modify",
      "old_id": "3a635e0d0125a1346dc8394c487a71061040ceda",
      "old_mode": 33188,
      "old_path": "clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h",
      "new_id": "73bece803cf15426979d932037b657f65a4d9c53",
      "new_mode": 33188,
      "new_path": "clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h"
    },
    {
      "type": "modify",
      "old_id": "a54c5bee612f6d6fef762631304b5b3de4ade1c2",
      "old_mode": 33188,
      "old_path": "clang/include/clang/StaticAnalyzer/Core/Checker.h",
      "new_id": "db3806b425dda6a91774a89389cd38e2e8804f18",
      "new_mode": 33188,
      "new_path": "clang/include/clang/StaticAnalyzer/Core/Checker.h"
    },
    {
      "type": "modify",
      "old_id": "03ffadd346d0b51dcbe0ef65bd53353a96d94fb4",
      "old_mode": 33188,
      "old_path": "clang/include/clang/StaticAnalyzer/Core/CheckerManager.h",
      "new_id": "58f59f7ab049f345fc43714c3ba8410be2acb4c6",
      "new_mode": 33188,
      "new_path": "clang/include/clang/StaticAnalyzer/Core/CheckerManager.h"
    },
    {
      "type": "modify",
      "old_id": "e508681410b0b4d9f9e2fa73efab1c9cb7b4b16b",
      "old_mode": 33188,
      "old_path": "clang/lib/Analysis/ProgramPoint.cpp",
      "new_id": "d7cd38a7325f57e3393d9a52aaf875299fea9f90",
      "new_mode": 33188,
      "new_path": "clang/lib/Analysis/ProgramPoint.cpp"
    },
    {
      "type": "modify",
      "old_id": "3dd57732305b22789caa612fa79a9c95f7ef7f0a",
      "old_mode": 33188,
      "old_path": "clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp",
      "new_id": "95a9582ecdcb1e8426613b3038bc295235c56f25",
      "new_mode": 33188,
      "new_path": "clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp"
    },
    {
      "type": "modify",
      "old_id": "217c46451f80f761c302eef32541defc02a349ef",
      "old_mode": 33188,
      "old_path": "clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp",
      "new_id": "ace3426387568596ea557435d533ae1ef43ba86f",
      "new_mode": 33188,
      "new_path": "clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp"
    },
    {
      "type": "modify",
      "old_id": "5b0d303ee5bbca4608a9497d3e1154edfc433c30",
      "old_mode": 33188,
      "old_path": "clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp",
      "new_id": "67429ee2c25f9a61ae887642049e9ff2da713592",
      "new_mode": 33188,
      "new_path": "clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp"
    },
    {
      "type": "modify",
      "old_id": "d5bc3ac2962d5c5c53a37ae51efb35f6d89e8197",
      "old_mode": 33188,
      "old_path": "clang/lib/StaticAnalyzer/Core/BugReporter.cpp",
      "new_id": "6aa44f08e3cb1abaa99feac837757ad1827ebc81",
      "new_mode": 33188,
      "new_path": "clang/lib/StaticAnalyzer/Core/BugReporter.cpp"
    },
    {
      "type": "modify",
      "old_id": "2bbb7a541457bbed33c7ce00809d6debc9ee5dba",
      "old_mode": 33188,
      "old_path": "clang/lib/StaticAnalyzer/Core/Checker.cpp",
      "new_id": "f5a07f5d305c58c1446fb81beb335e9f0c7373f0",
      "new_mode": 33188,
      "new_path": "clang/lib/StaticAnalyzer/Core/Checker.cpp"
    },
    {
      "type": "modify",
      "old_id": "7ae86f133904bb78d1571bbd2f203c1466a87ade",
      "old_mode": 33188,
      "old_path": "clang/lib/StaticAnalyzer/Core/CheckerManager.cpp",
      "new_id": "4c37b65ae5c68370b0cf095522b7211311aaadfa",
      "new_mode": 33188,
      "new_path": "clang/lib/StaticAnalyzer/Core/CheckerManager.cpp"
    },
    {
      "type": "modify",
      "old_id": "2940ff2e02891aeb6c094ad093f6d11fb5e93377",
      "old_mode": 33188,
      "old_path": "clang/test/Analysis/ftime-trace.cpp",
      "new_id": "e349eab8b62adbe7264df25e011e39803d3fc692",
      "new_mode": 33188,
      "new_path": "clang/test/Analysis/ftime-trace.cpp"
    }
  ]
}
