[qfcc] Remove strange split in function arg handling

I don't know why the last argument was handled differently. I suspect it
was a hold-over from before I added list handling. Removing it seems to
have made no significant difference (all tests pass still).
This commit is contained in:
Bill Currie 2024-10-10 19:17:24 +09:00
parent a0e4aa487f
commit f3181d64d0

View file

@ -2188,17 +2188,11 @@ build_function_call (const expr_t *fexpr, const type_t *ftype, const expr_t *par
emit_args = false;
expr_prepend_expr (args, new_args_expr ());
}
for (int i = 0; i < arg_expr_count - 1; i++) {
for (int i = 0; i < arg_expr_count; i++) {
scoped_src_loc (arg_exprs[i][0]);
auto assign = assign_expr (arg_exprs[i][1], arg_exprs[i][0]);
append_expr (call, assign);
}
if (arg_expr_count) {
scoped_src_loc (arg_exprs[arg_expr_count - 1][0]);
auto e = assign_expr (arg_exprs[arg_expr_count - 1][1],
arg_exprs[arg_expr_count - 1][0]);
append_expr (call, e);
}
auto ret_type = ftype->func.ret_type;
call->block.result = call_expr (fexpr, args, ret_type);
return call;