Skip to content

Commit fdf2b0a

Browse files
[LangRef] Document that sret only works with void returns (llvm#112167)
1 parent 751db4b commit fdf2b0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/docs/LangRef.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,12 +1309,14 @@ Currently, only the following parameter attributes are defined:
13091309
structure that is the return value of the function in the source
13101310
program. This pointer must be guaranteed by the caller to be valid:
13111311
loads and stores to the structure may be assumed by the callee not
1312-
to trap and to be properly aligned. This is not a valid attribute
1313-
for return values.
1312+
to trap and to be properly aligned.
13141313

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

1317+
A function that accepts an ``sret`` argument must return ``void``.
1318+
A return value may not be ``sret``.
1319+
13181320
.. _attr_elementtype:
13191321

13201322
``elementtype(<ty>)``

0 commit comments

Comments
 (0)