There is no functionality change here except in the way we assemble and
dump musttail calls in variadic functions. There's really no need to
separate out the bits for musttail and "is forwarding varargs" on call
instructions. A musttail call by definition has to forward the ellipsis
or it would fail verification.
Details
Diff Detail
Event Timeline
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?
docs/LangRef.rst | ||
---|---|---|
6594–6596 | "The callee must be varargs iff the caller is varargs"? |
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);
docs/LangRef.rst | ||
---|---|---|
6594–6596 | sure |
I haven't audited the codebase looking for places that assume that variadic callees must be passing in a discrete list of args, but every place I can think of (DAE, argpromotion, ipsccp) either skips varargs functions entirely or doesn't try to reason about the varargs part. Should be fine.
I see a problem in DAE, actually. I'll handle that in a separate commit. The test case for that feature is based on grep and needs work.
"The callee must be varargs iff the caller is varargs"?