Commit Graph

3 Commits

Author SHA1 Message Date
Artem Dergachev badba5118f [analyzer] NonnullGlobalConstants: Add support for kCFNull.
It's a singleton in CoreFoundation that always contains a non-null CFNullRef.
2019-12-18 12:08:15 -08:00
Artem Dergachev 512f4838c4 [analyzer] NonnullGlobalConstants: Don't be confused by a _Nonnull attribute.
The NonnullGlobalConstants checker models the rule "it doesn't make sense
to make a constant global pointer and initialize it to null"; it makes sure
that whatever it's initialized with is known to be non-null.

Ironically, annotating the type of the pointer as _Nonnull breaks the checker.

Fix handling of the _Nonnull annotation so that it was instead one more reason
to believe that the value is non-null.

Differential Revision: https://reviews.llvm.org/D63956

llvm-svn: 364869
2019-07-01 23:02:14 +00:00
George Karpenkov 9a542f7553 [Analyzer] Assume that CFBooleanRef const globals are non-null
Differential Revision: https://reviews.llvm.org/D38867

llvm-svn: 315655
2017-10-13 00:51:41 +00:00