Skip to content

Commit

Permalink
[LangRef] Clarify dereferenceable -> nonnull implication
Browse files Browse the repository at this point in the history
If `null_pointer_is_valid` is present, `dereferenceable` does not imply
`nonnull`, make it clear.

Came up in D17993.

Reviewed By: aqjune

Differential Revision: https://reviews.llvm.org/D89417
  • Loading branch information
jdoerfert committed Oct 28, 2020
1 parent b1a90e1 commit 1407783
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/docs/LangRef.rst
Expand Up @@ -1234,7 +1234,8 @@ Currently, only the following parameter attributes are defined:
size of the pointee type. The ``nonnull`` attribute does not imply
dereferenceability (consider a pointer to one element past the end of an
array), however ``dereferenceable(<n>)`` does imply ``nonnull`` in
``addrspace(0)`` (which is the default address space).
``addrspace(0)`` (which is the default address space), except if the
``null_pointer_is_valid`` function attribute is present.

``dereferenceable_or_null(<n>)``
This indicates that the parameter or return value isn't both
Expand Down

0 comments on commit 1407783

Please sign in to comment.