[PATCH] D89417: [LangRef] Clarify `dereferenceable` -> `nonnull` implication

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 11:57:41 PDT 2020


jdoerfert created this revision.
jdoerfert added reviewers: rsmith, fhahn, lebedev.ri, nlopes, arsenm, efriedma, aqjune.
Herald added a subscriber: bollu.
Herald added a project: LLVM.
jdoerfert requested review of this revision.
Herald added a subscriber: wdng.

If `null_pointer_is_valid` is present, `dereferenceable` does not imply
`nonnull`, make it clear.

Came up in D17993 <https://reviews.llvm.org/D17993>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89417

Files:
  llvm/docs/LangRef.rst


Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -1230,7 +1230,8 @@
     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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89417.298205.patch
Type: text/x-patch
Size: 691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201014/7750db5c/attachment.bin>


More information about the llvm-commits mailing list