]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/fortran/gfortran.h
fortran: simplify elemental arguments walking
authorMikael Morin <mikael@gcc.gnu.org>
Sun, 7 Nov 2021 13:40:11 +0000 (14:40 +0100)
committerMikael Morin <mikael@gcc.gnu.org>
Tue, 16 Nov 2021 18:07:50 +0000 (19:07 +0100)
commit5d9d16db96f2fcb47a00a7ce7e2d0e51400b47ab
tree718310f59f42f530df5e0028651fbf76b9f565b1
parent5888512f24121032a438e3aaf10dc93550dc2819
fortran: simplify elemental arguments walking

This adds two functions working with the wrapper struct gfc_dummy_arg
and makes usage of them to simplify a bit the walking of elemental
procedure arguments for scalarization.  As information about dummy arguments
can be obtained from the actual argument through the just-introduced
associated_dummy field, there is no need to carry around the procedure
interface and walk dummy arguments manually together with actual arguments.

gcc/fortran/ChangeLog:
* interface.c (gfc_dummy_arg_get_typespec,
gfc_dummy_arg_is_optional): New functions.
* gfortran.h (gfc_dummy_arg_get_typespec,
gfc_dummy_arg_is_optional): Declare them.
* trans.h (gfc_ss_info::dummy_arg): Use the wrapper type
as declaration type.
* trans-array.c (gfc_scalar_elemental_arg_saved_as_reference):
use gfc_dummy_arg_get_typespec function to get the type.
(gfc_walk_elemental_function_args): Remove proc_ifc argument.
Get info about the dummy arg using the associated_dummy field.
* trans-array.h (gfc_walk_elemental_function_args): Update declaration.
* trans-intrinsic.c (gfc_walk_intrinsic_function):
Update call to gfc_walk_elemental_function_args.
* trans-stmt.c (gfc_trans_call): Ditto.
(get_proc_ifc_for_call): Remove.
gcc/fortran/gfortran.h
gcc/fortran/interface.c
gcc/fortran/trans-array.c
gcc/fortran/trans-array.h
gcc/fortran/trans-intrinsic.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans.h