From 14077836ec0575320042585a80e4227bb0ee5be0 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 14 Oct 2020 13:54:20 -0500 Subject: [PATCH] [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 --- llvm/docs/LangRef.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.7.4