This callback is called when the analysis starts. It could be used to
construct the checker's fields which are related to the Preprocessor.
void CoolFunctionChecker::checkBeginAnalysis(CheckerContext &C) const { Preprocessor &PP = C.getPreprocessor(); UseMyCoolLib = PP.isMacroDefined("__MY_COOL_LIB__"); }
Hmmm, what use case do you have in mind? Do we actually want this to happen? By the time checkers are constructed, the AST is already built, alongside all the other data structures that will be inspected by the analyzer. Since checkers are constructed once for each clang invocation (not for every BeginAnalysis -- EndAnalysis cycle), I would imagine that the checker registry functions are more appropriate for such initializations.
I'm only aware of one non-debug checker that uses EndAnalysis (maybe RetailCount?), that clears some sort of a locally stored map that it shouldn't really have anyways (since checkers are supposed to be stateless), and I struggle to think of a realistic, supported use case for this callback other than debug checkers.