[llvm-dev] Why the platform dependent "va_list" variable is lowered by the frontend?

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 27 06:04:40 PST 2016


On Wed, Jan 27, 2016 at 02:11:17PM +0100, Gaël Jobin via llvm-dev wrote:
> I was playing with varargs and was wondering why the va_list variable
> in C is lowered by the frontend to a *i8 (x86) or a struct (x86_64)? I
> mean, if it depends on the architecture, it is more logical to have an
> IR intrinsic for va_list and let the backend lowering it to the right
> type. 

On many architectures, the IR support for variadic function calls is
quite limited due to the complexity of the ABIs involved. As the
frontend is then responsible for the doing the right thing esp. for
va_arg, it most of intimate knowledge already.

Joerg


More information about the llvm-dev mailing list