[PATCH] D79420: [analyzer] Make NonNullParamChecker as dependency for StdCLibraryFunctionsChecker

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 6 08:02:54 PDT 2020


martong added a comment.

In D79420#2022237 <https://reviews.llvm.org/D79420#2022237>, @xazax.hun wrote:

> > If a given parameter in a FunctionDecl has a nonull attribute then the NonNull constraint in StdCLibraryFunctionsChecker has the same effect as NonNullParamChecker.
>
> Wait, where the diagnostic is coming from?


StdCLibraryFunctionArgs are responsible for emitting diags. This is a subchecker of `StdCLibraryFunctions`, and can be disabled separately.

> My point is, the user should be able to turn `apiModeling.StdCLibraryFunctions` on, while suppressing all the null related diagnostics. Is this possible now? Is this possible after this change?

Yes, in both cases (before and after this change). By enabling StdCLibraryFunctions and disabling StdCLibraryFunctionArgs and also disabling NonNullParamChecker. (But the last one is in core, so the user should not do that.) This patch changes only the order evaluation order, from now on NonNullParamChecker's callbacks will be called earlier.

> As long as it is possible to separately turn on modeling independently form the diagnostics, it looks good to me.

Yes, that is possible, so I consider this as an LGTM :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79420/new/

https://reviews.llvm.org/D79420





More information about the cfe-commits mailing list