This patch adds an attribute inline_va_arg_pack which applies to calls/invokes and is the result of lowering __builtin_va_arg_pack(), as well as the intrinsic @llvm.va_arg_pack_len, which is the result of lowering __builtin_va_arg_pack_len(). These can only appear in available_externally functions, and are themselves lowered during inlining. You can read more about them here: https://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Constructing-Calls.html, I explained the motivation for them on the clang patch.
Fixes llvm.org/PR7219 & rdar://11102669
Thanks for taking a look!
Erik
I'm not really a fan of using an attribute like this. Currently, there are basically two ways to refer to a varargs list: va_start, and a musttail call. This is adding a third, in a way that's very easy to miss.
Not sure what it should look like, though. Maybe instead of calling the function directly, we should call an intrinsic? I guess any approach has odd semantic implications.