Page MenuHomePhabricator

[analyzer][NFC] Move CheckerRegistry from the Core directory to Frontend

Authored by Szelethus on Nov 12 2018, 11:22 AM.



ClangCheckerRegistry is a very non-obvious, poorly documented, weird concept. It derives from CheckerRegistry, and is placed in lib/StaticAnalyzer/Frontend, whereas it's base is located in lib/StaticAnalyzer/Core. It was, from what I can imagine, used to circumvent the problem that the registry functions of the checkers are located in the clangStaticAnalyzerCheckers library, but that library depends on clangStaticAnalyzerCore. However, clangStaticAnalyzerFrontend depends on both of those libraries.

One can make the observation however, that CheckerRegistry has no place in Core, it isn't used there at all! The only place where it is used is Frontend, which is where it ultimately belongs.

This move implies that since include/clang/StaticAnalyzer/Checkers/ClangCheckers.h only contained a single function:

class CheckerRegistry;

void registerBuiltinCheckers(CheckerRegistry &registry);

it had to re purposed, as CheckerRegistry is no longer available to clangStaticAnalyzerCheckers. It was renamed to BuiltinCheckerRegistration.h, which actually describes it a lot better -- it does not contain the registration functions for checkers, but only those generated by the tblgen files.

Diff Detail


Event Timeline

Szelethus created this revision.Nov 12 2018, 11:22 AM
Szelethus edited the summary of this revision. (Show Details)Nov 12 2018, 12:16 PM
Szelethus edited the summary of this revision. (Show Details)

Polite ping :)

NoQ accepted this revision.Nov 30 2018, 3:45 PM

Thanks for the cleanup!

One thing to test here is whether this works (or, at least, builds) when compiling clang without the analyzer.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 15 2018, 8:27 AM
This revision was automatically updated to reflect the committed changes.