Skip to content

Commit

Permalink
[LangRef] Document that sret only works with void returns (#112167)
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee authored Oct 14, 2024
1 parent 751db4b commit fdf2b0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1309,12 +1309,14 @@ Currently, only the following parameter attributes are defined:
structure that is the return value of the function in the source
program. This pointer must be guaranteed by the caller to be valid:
loads and stores to the structure may be assumed by the callee not
to trap and to be properly aligned. This is not a valid attribute
for return values.
to trap and to be properly aligned.

The sret type argument specifies the in memory type, which must be
the same as the pointee type of the argument.

A function that accepts an ``sret`` argument must return ``void``.
A return value may not be ``sret``.

.. _attr_elementtype:

``elementtype(<ty>)``
Expand Down

0 comments on commit fdf2b0a

Please sign in to comment.