Skip to content

Commit d490c74

Browse files
committed
Special case NoDiagnoseCallsToSystemHeaders as group-level option
1 parent 3ca23ce commit d490c74

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,16 @@ void NullabilityChecker::printState(raw_ostream &Out, ProgramStateRef State,
14031403
}
14041404
}
14051405

1406+
// The checker group "nullability" consists of the checkers that are
1407+
// implemented as the parts of the checker class `NullabilityChecker`. These
1408+
// checkers share a checker option "nullability:NoDiagnoseCallsToSystemHeaders"
1409+
// which semantically belongs to the whole group and not just one checker from
1410+
// it. As this is a unique situation (I don't know about any other similar
1411+
// group-level option) there is no mechanism to inject this group name from
1412+
// e.g. Checkers.td, so I'm just hardcoding it here. (These are old stable
1413+
// checkers, I don't think that their name will change.)
1414+
#define CHECKER_GROUP_NAME "nullability"
1415+
14061416
#define REGISTER_CHECKER(Part, TrackingRequired) \
14071417
void ento::register##Part##Checker(CheckerManager &Mgr) { \
14081418
auto *Checker = Mgr.registerChecker<NullabilityChecker, \
@@ -1411,8 +1421,7 @@ void NullabilityChecker::printState(raw_ostream &Out, ProgramStateRef State,
14111421
Checker->NoDiagnoseCallsToSystemHeaders = \
14121422
Checker->NoDiagnoseCallsToSystemHeaders || \
14131423
Mgr.getAnalyzerOptions().getCheckerBooleanOption( \
1414-
Mgr.getCurrentCheckerName(), "NoDiagnoseCallsToSystemHeaders", \
1415-
true); \
1424+
CHECKER_GROUP_NAME, "NoDiagnoseCallsToSystemHeaders", true); \
14161425
} \
14171426
\
14181427
bool ento::shouldRegister##Part##Checker(const CheckerManager &) { \

0 commit comments

Comments
 (0)