[PATCH] D124124: [LangRef] Limit read/writeonly attrs to memory visible to caller

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 14:07:19 PDT 2022


fhahn created this revision.
fhahn added reviewers: nikic, nlopes, reames, efriedma.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
fhahn requested review of this revision.
Herald added a project: LLVM.

This patch unifies the wording used for both readonly and writeonly
attributes. Both descriptions more specifically refer to memory visible
to caller functions, like in the first paragraph of the readonly
definition.

The motivation for the clarification is D123473 <https://reviews.llvm.org/D123473>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124124

Files:
  llvm/docs/LangRef.rst


Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -1901,7 +1901,7 @@
     through this pointer argument, even though it may write to the memory that
     the pointer points to.
 
-    If a readonly function writes memory visible to the program, or
+    If a readonly function writes memory visible to a caller function, or
     has other side-effects, the behavior is undefined. If a function writes to
     a readonly pointer argument, the behavior is undefined.
 ``"stack-probe-size"``
@@ -1923,13 +1923,13 @@
     This attribute disables ABI-required stack probes, if any.
 ``writeonly``
     On a function, this attribute indicates that the function may write to but
-    does not read from memory.
+    does not read from memory visible to caller functions.
 
     On an argument, this attribute indicates that the function may write to but
     does not read through this pointer argument (even though it may read from
     the memory that the pointer points to).
 
-    If a writeonly function reads memory visible to the program, or
+    If a writeonly function reads memory visible to a caller function, or
     has other side-effects, the behavior is undefined. If a function reads
     from a writeonly pointer argument, the behavior is undefined.
 ``argmemonly``


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124124.424020.patch
Type: text/x-patch
Size: 1377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220420/d82d8482/attachment.bin>


More information about the llvm-commits mailing list