================ @@ -1394,35 +1403,34 @@ void NullabilityChecker::printState(raw_ostream &Out, ProgramStateRef State, } } -void ento::registerNullabilityBase(CheckerManager &mgr) { - mgr.registerChecker<NullabilityChecker>(); -} - -bool ento::shouldRegisterNullabilityBase(const CheckerManager &mgr) { - return true; -} - -#define REGISTER_CHECKER(name, trackingRequired) \ - void ento::register##name##Checker(CheckerManager &mgr) { \ - NullabilityChecker *checker = mgr.getChecker<NullabilityChecker>(); \ - checker->ChecksEnabled[NullabilityChecker::CK_##name] = true; \ - checker->CheckNames[NullabilityChecker::CK_##name] = \ - mgr.getCurrentCheckerName(); \ - checker->NeedTracking = checker->NeedTracking || trackingRequired; \ - checker->NoDiagnoseCallsToSystemHeaders = \ - checker->NoDiagnoseCallsToSystemHeaders || \ - mgr.getAnalyzerOptions().getCheckerBooleanOption( \ - checker, "NoDiagnoseCallsToSystemHeaders", true); \ +// The checker group "nullability" consists of the checkers that are +// implemented as the parts of the checker class `NullabilityChecker`. These +// checkers share a checker option "nullability:NoDiagnoseCallsToSystemHeaders" +// which semantically belongs to the whole group and not just one checker from +// it. As this is a unique situation (I don't know about any other similar +// group-level option) there is no mechanism to inject this group name from +// e.g. Checkers.td, so I'm just hardcoding it here. (These are old stable +// checkers, I don't think that their name will change.) ---------------- NagyDonat wrote:
Before this PR, the registration functions of the (real) checker parts actually tested the presence of the checker option `nullability.NullabilityBase:NoDiagnoseCallsToSystemHeaders`, where `nullability.NullabilityBase` was the hidden dummy checker part that was added as a prerequisite of all the "real" checker parts. (Note that -- ironically -- `registerNullabilityBase()` did _not_ check for the presence of this option which was nominally attached to it.) This was working because in the checker option handling code specifying an option on the group level (e.g. saying `nullability:NoDiagnoseCallsToSystemHeaders=true`) is roughly equivalent to passing it to every checker within the group. In commit https://github.com/llvm/llvm-project/pull/132250/commits/d490c74ea866107be4131bd6e694166e702ed8aa I'm turning this option into a "real" group-level option by passing the group name to `getCheckerBooleanOption`. ------- By the way the name of this option is really ugly -- it should be `DiagnoseCallsToSystemHeaders` with negated meaning -- but that's a problem for another commit. https://github.com/llvm/llvm-project/pull/132250 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits