[PATCH] D41861: [LangRef] Clarify Varargs forwarding for musttail calls.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 06:15:20 PST 2018


fhahn created this revision.
fhahn added reviewers: hfinkel, efriedma.

This clarification was suggested by @efriedma in https://reviews.llvm.org/D41335, which uses this
behavior to inline musttail calls with varargs.


https://reviews.llvm.org/D41861

Files:
  docs/LangRef.rst


Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -9047,9 +9047,10 @@
    - The calling conventions of the caller and callee must match.
    - All ABI-impacting function attributes, such as sret, byval, inreg,
      returned, and inalloca, must match.
-   - The callee must be varargs iff the caller is varargs. Bitcasting a
-     non-varargs function to the appropriate varargs type is legal so
-     long as the non-varargs prefixes obey the other rules.
+   - The callee must be varargs iff the caller is varargs. If the callee is
+     varargs, the varargs passed to the caller will get passed to the callee
+     too. Bitcasting a non-varargs function to the appropriate varargs type is
+     legal so long as the non-varargs prefixes obey the other rules.
 
    Tail call optimization for calls marked ``tail`` is guaranteed to occur if
    the following conditions are met:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41861.129072.patch
Type: text/x-patch
Size: 968 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180109/db929d20/attachment.bin>


More information about the llvm-commits mailing list