[LLVMdev] Declaration of a va_list should be an intrinsic?

Andrew Lenharth andrewl at lenharth.org
Tue Apr 3 08:08:20 PDT 2007


On 4/3/07, Nicolas Geoffray <nicolas.geoffray at lip6.fr> wrote:
> Hi Andrew,
> We can set the type of the va_list to be i8* or i8**. Even if internally
> it's something else.

Yes, in the backend it just lowers to a reserved stack object of the
correct size (the TargetLowering should just set the size for va_list
and the lowering should turn it into a stack object I think).  This
should only require one more like of code to each target.

> > Right now, vaarg
> > handling is not target independent at the llvm level.
> Isn't this an error at the conception level? llvm bytecode should be
> target independent.

I think so.  There is no way, currently to really optimize/generate
vaargs in a target independent manner.  It would be nice if we could.

> > I agree that a
> > va_list alloc intrinsic would go a long way towards abstracting the
> > target ABI from a vaarg function.
> So you agree that it's the correct way to implement this target-dependant
> feature? Updating all backends shouldn't be too hard.

I don't see a problem with it.

Andrew



More information about the llvm-dev mailing list