This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][StdLibraryFunctionsChecker] Have proper weak dependencies
ClosedPublic

Authored by martong on Sep 7 2020, 8:21 AM.

Details

Summary

We want the generice StdLibraryFunctionsChecker to report only if there
are no specific checkers that would handle the argument constraint for a
function.

Note, the assumptions are still evaluated, even if the arguement
constraint checker is set to not report. This means that the assumptions
made in the generic StdLibraryFunctionsChecker should be an
over-approximation of the assumptions made in the specific checkers. But
most importantly, the assumptions should not contradict.

Diff Detail

Event Timeline

martong created this revision.Sep 7 2020, 8:21 AM
martong requested review of this revision.Sep 7 2020, 8:21 AM
Szelethus accepted this revision.Sep 7 2020, 8:30 AM

This is exactly how I imagines weak dependencies to work. LGTM on my end.

This revision is now accepted and ready to land.Sep 7 2020, 8:30 AM
This revision was landed with ongoing or failed builds.Sep 7 2020, 8:56 AM
This revision was automatically updated to reflect the committed changes.
martong added inline comments.Sep 15 2020, 7:32 AM
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
352

Umm, we should not have removed this. The checker always asserts that the arguments are initialized and that is checked by the dependency.

This is causing an assertion in D87081. Unfortunately, we hadn't have any tests to catch this, but now we have one, exactly in D87081. So I am putting back this dependency there.