From: Johannes Doerfert Date: Wed, 14 Oct 2020 18:54:20 +0000 (-0500) Subject: [LangRef] Clarify `dereferenceable` -> `nonnull` implication X-Git-Tag: llvmorg-13-init~7942 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14077836ec0575320042585a80e4227bb0ee5be0;p=platform%2Fupstream%2Fllvm.git [LangRef] Clarify `dereferenceable` -> `nonnull` implication 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 --- diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index a70952d..7e3320b 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -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()`` 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()`` This indicates that the parameter or return value isn't both