[LangRef] Clarify `dereferenceable` -> `nonnull` implication
authorJohannes Doerfert <johannes@jdoerfert.de>
Wed, 14 Oct 2020 18:54:20 +0000 (13:54 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 28 Oct 2020 00:12:53 +0000 (19:12 -0500)
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

llvm/docs/LangRef.rst

index a70952d..7e3320b 100644 (file)
@@ -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