diff options
| author | Reid Kleckner <rnk@google.com> | 2019-05-24 01:45:47 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2019-05-24 01:45:47 +0000 |
| commit | 414da9d66a5469e46a804611a2fc2a6fad543484 (patch) | |
| tree | a9ca3ca023f8892138810d6bf338b19be02325e6 /llvm/docs | |
| parent | fc302c2b7f1c224be03caba3a82282a943a31519 (diff) | |
| download | bcm5719-llvm-414da9d66a5469e46a804611a2fc2a6fad543484.tar.gz bcm5719-llvm-414da9d66a5469e46a804611a2fc2a6fad543484.zip | |
Clarify how musttail can be used to create forwarding thunks
llvm-svn: 361590
Diffstat (limited to 'llvm/docs')
| -rw-r--r-- | llvm/docs/LangRef.rst | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 5ea27c976d2..6311f6f6163 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -10006,12 +10006,16 @@ This instruction requires several arguments: recursive cycle in the call graph. #. Arguments with the :ref:`inalloca <attr_inalloca>` attribute are forwarded in place. + #. If the musttail call appears in a function with the ``"thunk"`` attribute + and the caller and callee both have varargs, than any unprototyped + arguments in register or memory are forwarded to the callee. Similarly, + the return value of the callee is returned the the caller's caller, even + if a void return type is in use. Both markers imply that the callee does not access allocas from the caller. The ``tail`` marker additionally implies that the callee does not access - varargs from the caller, while ``musttail`` implies that varargs from the - caller are passed to the callee. Calls marked ``musttail`` must obey the - following additional rules: + varargs from the caller. Calls marked ``musttail`` must obey the following + additional rules: - The call must immediately precede a :ref:`ret <i_ret>` instruction, or a pointer bitcast followed by a ret instruction. |

