Mikael Morin wrote:
Add accessor functions to get or set the value of the rank field of
array descriptors, and remove from the public API the function giving
direct acces to the field.

I note that gfc_conv_descriptor_rank_set takes either an int or a
tree, the latter is used by gfc_conv_gfc_desc_to_cfi_desc, which
needs to handle also assumed-rank variables.

gcc/fortran/ChangeLog:

        * trans-descriptor.cc (gfc_conv_descriptor_rank): Make static and
        rename ...
        (conv_descriptor_rank): ... to this.
        (gfc_conv_descriptor_rank_get, gfc_conv_descriptor_rank_set): New
        functions.
        * trans-descriptor.h (gfc_conv_descriptor_rank): Remove declaration.
        (gfc_conv_descriptor_rank_get, gfc_conv_descriptor_rank_set): New
        declarations.
        * trans-array.cc (gfc_trans_create_temp_array,
        gfc_conv_ss_startstride, gfc_tree_array_size,
        gfc_conv_array_parameter, gfc_full_array_size,
        duplicate_allocatable_coarray): Use gfc_conv_descriptor_rank_get
        to get the value of the rank field, and gfc_conv_descriptor_rank_set
        to set it.
        * trans-decl.cc (gfc_conv_cfi_to_gfc): Likewise.
        * trans-expr.cc (gfc_conv_variable, gfc_conv_gfc_desc_to_cfi_desc,
        conv_null_actual, gfc_trans_structure_assign): Likewise.
        * trans-intrinsic.cc (gfc_conv_intrinsic_rank,
        gfc_conv_intrinsic_bound, gfc_conv_intrinsic_sizeof,
        gfc_conv_associated): Likewise.
        * trans-openmp.cc (gfc_omp_get_array_size): Likewise.
        * trans-stmt.cc (gfc_trans_select_rank_cases): Likewise.

LGTM. Thanks!

Tobias

PS: I know that patches 5 to 11 are still missing, but I will first do something else before coming back to them. (Hopefully later today.) They require some more attention when reading them.

Reply via email to