This is an archive of the discontinued LLVM Phabricator instance.

Updated getNullabilityAnnotation for checkers
Needs ReviewPublic

Authored by chrisbazley on Jan 27 2023, 8:50 AM.

Details

Reviewers
NoQ
Summary

NullabilityChecker and TrustNonnullChecker use
a pre-existing helper function,
getNullabilityAnnotation() to get a Nullability
value from a QualType.

That function is now updated to return
Nullability::Nullable if the given type is a
pointer to an _Optional-qualified type. The
purpose is to allow declarations such as

_Optional int *x;

to be treated (for static analysis purposes) as
equivalent to

int *_Nullable x;

thereby removing one barrier to adoption of the
_Optional type qualifier.

Diff Detail