Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLVM] Doc sret only works with void returns #112167

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

workingjubilee
Copy link
Contributor

This was discussed on Discord by schombert and @nikic.

@llvmbot
Copy link
Member

llvmbot commented Oct 14, 2024

@llvm/pr-subscribers-llvm-ir

Author: Jubilee (workingjubilee)

Changes

This was discussed on Discord by schombert and @nikic.


Full diff: https://github.com/llvm/llvm-project/pull/112167.diff

1 Files Affected:

  • (modified) llvm/docs/LangRef.rst (+4-2)
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 6fa35486669d69..d835ab0d2a93f1 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -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>)``

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nikic nikic merged commit fdf2b0a into llvm:main Oct 14, 2024
11 checks passed
@workingjubilee workingjubilee deleted the sret-must-be-void branch October 14, 2024 17:44
DanielCChen pushed a commit to DanielCChen/llvm-project that referenced this pull request Oct 16, 2024
bricknerb pushed a commit to bricknerb/llvm-project that referenced this pull request Oct 17, 2024
EricWF pushed a commit to efcs/llvm-project that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants