Re: [PATCH v3 2/3] Pass return_method to _push_dummy_call

Pedro Alves
2018-10-19T11:31:52Z

On 10/11/2018 03:49 PM, Alan Hayward wrote:
> /* First determine how much stack space we will need. */
> - for (i = 0, argreg = E_1ST_ARGREG + (struct_return != 0); i < nargs; i++)
> + for (i = 0, argreg = E_1ST_ARGREG + (return_method == return_method_struct);
> + i < nargs; i++)

Please write:

for (i = 0, argreg = E_1ST_ARGREG + (return_method == return_method_struct);
i < nargs;
i++)

I.e., once you have to break one the statements, it reads better to break
them all.

> @@ -238,7 +239,7 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
>
> /* If struct_return is true, then the struct return address will
> consume one argument-passing register. */

This comment needs a slight update.

> - if (struct_return)
> + if (return_method == return_method_struct)

> @@ -1577,7 +1578,7 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
> }
>
> /* The struct_return pointer occupies X8. */
> - if (struct_return || lang_struct_return)
> + if (return_method != return_method_normal)
> {

I think in this patch, this should still read:

if (return_method == return_method_struct || lang_struct_return)

So that the patch has no side effects other than passing the
return_method down.

Thanks,
Pedro Alves