[LLVMdev] Is va_arg deprecated?

Rafael Espindola espindola at google.com
Mon Jul 19 17:03:16 PDT 2010

On 19 July 2010 14:57, Neal  N. Wang <neal.wang at gmail.com> wrote:
> Hi folk,
> I'm writing a set of small C code to verify whether my pass handle some
> instruction correctly.   One of the instruction I want to test is "va_arg",
> but compiling my variadic function does not generate any va_arg instruction.
> Is va_arg deprecated? Will va_arg instruction ever be generated by any
> front-end?  The source code and llvm instructions are appended as follows.

Currently both clang and llvm-gcc lower va_arg. As David mentioned, we
are experimenting with va_arg. Some bits were pushed upstream, some
are in our public svn repo waiting for more testing/cleanup or just
time to send it upstream. With those patches it is possible to use
va_arg, but they are not as tested and the code is not as good (we
load and store the va_list every time for example).

It should be possible to improve the code generated by va_arg and some
optimizations might also be easier to implement with it, but it is not
done yet.

So, there is hope that va_arg will be used, but currently it isn't.

Rafael Ávila de Espíndola

More information about the llvm-dev mailing list