diff options
Diffstat (limited to 'gcc/tree.cc')
| -rw-r--r-- | gcc/tree.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gcc/tree.cc b/gcc/tree.cc index 298784e..4c8e31c 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -11031,32 +11031,34 @@ build_call_1 (tree return_type, tree fn, int nargs) /* Build a CALL_EXPR of class tcc_vl_exp with the indicated RETURN_TYPE and FN and a null static chain slot. NARGS is the number of call arguments - which are specified as "..." arguments. */ + which are specified as a va_list ARGS. */ tree -build_call_nary (tree return_type, tree fn, int nargs, ...) +build_call_valist (tree return_type, tree fn, int nargs, va_list args) { - tree ret; - va_list args; - va_start (args, nargs); - ret = build_call_valist (return_type, fn, nargs, args); - va_end (args); - return ret; + tree t; + int i; + + t = build_call_1 (return_type, fn, nargs); + for (i = 0; i < nargs; i++) + CALL_EXPR_ARG (t, i) = va_arg (args, tree); + process_call_operands (t); + return t; } /* Build a CALL_EXPR of class tcc_vl_exp with the indicated RETURN_TYPE and - FN and a null static chain slot. NARGS is the number of call arguments - which are specified as a va_list ARGS. */ + FN and a null static chain slot. ARGS specifies the call arguments. */ tree -build_call_valist (tree return_type, tree fn, int nargs, va_list args) +build_call (tree return_type, tree fn, std::initializer_list<tree> args) { tree t; int i; + int nargs = args.size(); t = build_call_1 (return_type, fn, nargs); for (i = 0; i < nargs; i++) - CALL_EXPR_ARG (t, i) = va_arg (args, tree); + CALL_EXPR_ARG (t, i) = args.begin()[i]; process_call_operands (t); return t; } |
