On Tue, May 7, 2013 at 5:20 AM, Jason Merrill <ja...@redhat.com> wrote:
> Most build_* functions have variadic versions, but build_constructor doesn't
> as of yet, and it would be convenient for a patch I'm working on.  I decided
> to call it build_constructor_va, but am open to other naming ideas.
>
> Tested x86_64-pc-linux-gnu.  OK for trunk?

Eh, two NULL_TREE terminators are ugly ... callers know the number of elements,
so maybe instead pass that number as argument?

It looks like build_constructor_single can be implemented (or
completely replaced by)
build_constructor_va (build_constructor_single is nearly unused).

Can we overload build_constructor with a variadic variant?  Thus,

tree build_constructor (tree type, vec<constructor_elt, va_gc> *vals);
tree build_constructor (tree type, unsigned n, ...);

one of the nice things of using C++ is that we don't have to invent fancy
names for different interfaces of the same thing.

Richard.

Reply via email to