[llvm] 1407783 - [LangRef] Clarify `dereferenceable` -> `nonnull` implication

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 17:13:09 PDT 2020


Author: Johannes Doerfert
Date: 2020-10-27T19:12:53-05:00
New Revision: 14077836ec0575320042585a80e4227bb0ee5be0

URL: https://github.com/llvm/llvm-project/commit/14077836ec0575320042585a80e4227bb0ee5be0
DIFF: https://github.com/llvm/llvm-project/commit/14077836ec0575320042585a80e4227bb0ee5be0.diff

LOG: [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

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index a70952d7b8c9..7e3320b2fe2e 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(<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


        


More information about the llvm-commits mailing list