On 10/27/25 11:29 PM, Andrew Pinski wrote:
Instead of a va_list here we can create a std::initializer_list that contains 
the
arguments and pass that.
This is just one quick version of what was mentioned during the Reviewing 
refactoring
goals and acceptable abstractions.
The generated code should be similar or slightly better. Plus there is extra 
checking
of bounds of the std::initializer_list.

I didn't remove the n argument from build_call_nary at this stage as I didn't 
want to change
the calls to build_call_nary but I added a gcc_checking_assert to make sure the 
number passed
is the number of arguments.

gcc/ChangeLog:

        * tree.cc (build_call_nary): Remove decl.
        Add template definition that uses std::initializer_list<tree>
        and call build_call.
        (build_call): New declaration.
        * tree.h (build_call_nary): Remove.
        (build_call): New function.
Presumably the main gain here is the bounds checking.  Regardless.  OK.

jeff

Reply via email to