[PATCH] Declare that musttail calls in variadic functions forward the ellipsis

Reid Kleckner rnk at google.com
Mon Aug 25 17:10:37 PDT 2014

>>! In D4892#5, @nlewycky wrote:
> I'm concerned that there's no Verifier change. It looks like you don't need one, which means that we failed at code review previously since there was code that was valid but we couldn't print or parse? Or is there a verifier change missing?

We already have the check for this rule. I think you were the one who asked me to add it:
  Assert1(CallerTy->isVarArg() == CalleeTy->isVarArg(),
          "cannot guarantee tail call due to mismatched varargs", &CI);

Comment at: docs/LangRef.rst:6539-6541
@@ -6538,2 +6538,5 @@
      returned, and inalloca, must match.
+   - If the caller is varargs, the callee must be varargs. Bitcasting a
+     non-varargs function to the appropriate varargs type is legal so
+     long as the non-varargs prefixes obey the other rules.
nlewycky wrote:
> "The callee must be varargs iff the caller is varargs"?


More information about the llvm-commits mailing list