File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -1743,15 +1743,18 @@ Currently, only the following parameter attributes are defined:
1743
1743
1744
1744
``dead_on_return``
1745
1745
This attribute indicates that the memory pointed to by the argument is dead
1746
- upon normal function return.
1747
-
1748
- It is similar to ``byval`` in the regard that it is generally used to pass
1749
- structs and arrays by value, and the memory is caller-invisible when the
1750
- function returns. However, unlike ``byval``, it is intended for ABIs where the
1751
- *callee* explicitly allocates the temporary copy. Stores that would only be
1752
- visible on the normal return path may be optimized out. Likewise,
1753
- optimizations may assume that the pointer does not alias any memory that
1754
- outlives the call.
1746
+ upon normal function return, meaning that the caller will not depend on its
1747
+ contents. Stores that would only be observable on the normal return path may
1748
+ be elided.
1749
+
1750
+ Specifically, the behavior is as-if any memory written through the pointer
1751
+ during the execution of the function is overwritten with a poison value
1752
+ upon normal function return. The caller may access the memory, but any load
1753
+ not preceded by a store will return poison.
1754
+
1755
+ This attribute does not imply aliasing properties. For pointer arguments that
1756
+ do not alias other memory locations, ``noalias`` attribute may be used in
1757
+ conjunction.
1755
1758
1756
1759
This attribute cannot be applied to return values.
1757
1760
You can’t perform that action at this time.
0 commit comments