[LLVMdev] va_arg

Eli Friedman eli.friedman at gmail.com
Fri Aug 28 15:48:59 PDT 2009


On Fri, Aug 28, 2009 at 3:07 PM, Scott Ricketts<sricketts at maxentric.com> wrote:
> I would like to be able to instrument va_arg, but when I generate a bc
> file for a test case using:
>
> llvm-gcc -O3 -emit-llvm vararg.c -c -o vararg.bc
>
> I do not see va_arg. Instead, it seems the args are accessed through
> %struct.__va_list_tag, which makes things a bit trickier to
> instrument. Is there a way to force llvm-gcc to use va_arg?

No; llvm-gcc always lowers it in the front-end. Among other issues,
CodeGen doesn't support va_arg on x86-64
(http://llvm.org/bugs/show_bug.cgi?id=1740).

If you want to know what it's doing, I'd suggest looking at
http://www.x86-64.org/documentation/abi.pdf .

-Eli



More information about the llvm-dev mailing list