]> granicus.if.org Git - llvm/commitdiff
Clarify how musttail can be used to create forwarding thunks
authorReid Kleckner <rnk@google.com>
Fri, 24 May 2019 01:45:47 +0000 (01:45 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 24 May 2019 01:45:47 +0000 (01:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361590 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LangRef.rst

index 5ea27c976d2aec6951c91f0dc7be3748acdfaeec..6311f6f616369651b3adcc227ed3da7412b1bb28 100644 (file)
@@ -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.