[PATCH] D56989: [analyzer][NFC] Fully initialize CheckerRegistry in by the end of construction

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 20 16:26:48 PST 2019


Szelethus created this revision.
Szelethus added reviewers: NoQ, george.karpenkov, xazax.hun, rnkovacs, baloghadamsoftware.
Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, mgrang, szepet, whisperity.
Szelethus retitled this revision from "[analyzer][NFC] Fully initialize CheckerRegistry in by the end of construction, make all methods const" to "[analyzer][NFC] Fully initialize CheckerRegistry in by the end of construction".

One of the bugs that I left in in my dependency patch D54438 <https://reviews.llvm.org/D54438> was luckily discovered thanks to @george.karpenkov commiting a patch a couple days before I attempted to commit: Namely, the rigid structure of how the user can enable/disable checkers wasn't respected, and chaos ensued when a dependency was disabled, but the checker that was depending on it was enabled.

This patch moves all the code that modifies the state of `CheckerRegistry` into it's constructor, ensuring that once constructed, it'll be in its final state.

The important thing here is that I added a new enum to `CheckerInfo`, so we can easily track whether the check is explicitly enabled, explicitly disabled, or isn't specified in this regard. Checkers belonging in the latter category may be implicitly enabled through dependencies in the followup patch.


Repository:
  rC Clang

https://reviews.llvm.org/D56989

Files:
  include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
  lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56989.182723.patch
Type: text/x-patch
Size: 9100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190121/0e623880/attachment-0001.bin>


More information about the cfe-commits mailing list