diff options
author | Tobias Burnus <tburnus@baylibre.com> | 2025-02-21 08:54:12 +0100 |
---|---|---|
committer | Tobias Burnus <tburnus@baylibre.com> | 2025-02-21 08:54:12 +0100 |
commit | 8293b9e40f12e94a0fdae61b6ec7f2c25ac5b699 (patch) | |
tree | dfbb821dbd9f5984976081c4480f1aa1fcfa8789 /gcc/fortran/trans.h | |
parent | fe4811fd19f67bbe35aba3002bb70c225dbf6a24 (diff) | |
download | gcc-8293b9e40f12e94a0fdae61b6ec7f2c25ac5b699.zip gcc-8293b9e40f12e94a0fdae61b6ec7f2c25ac5b699.tar.gz gcc-8293b9e40f12e94a0fdae61b6ec7f2c25ac5b699.tar.bz2 |
Fortran: Improve gfc_array_kind for assumed rank; gfc_tree_array_size on 'tree'
Improve the internal and debug representation of assumed-rank arrays by
honoring the pointer and allocatable property.
Permit obtaining the array size from only a tree (via the array descriptor)
besides obtaining it from the gfc_expr's array spec. This will be used
by a follow up OpenMP patch for mapping derived types with allocatable
components.
gcc/fortran/ChangeLog:
* trans-array.cc (gfc_full_array_size): Obtain the rank from
the array descriptor for assumed rank.
(gfc_tree_array_size): Likewise; permit expr = NULL to operate
only the tree.
(gfc_conv_descriptor_stride_get): Update for added assumed-rank
array types.
* trans-openmp.cc (gfc_omp_finish_clause): Likewise.
* trans-types.cc (gfc_build_array_type, gfc_get_derived_type,
gfc_get_array_descr_info): Likewise.
* trans.h (enum gfc_array_kind): Add
GFC_ARRAY_ASSUMED_RANK_{ALLOCATABLE,POINTER{,_CONT}}.
Diffstat (limited to 'gcc/fortran/trans.h')
-rw-r--r-- | gcc/fortran/trans.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index e22e0f1..69c3d90 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -1012,6 +1012,9 @@ enum gfc_array_kind GFC_ARRAY_ASSUMED_SHAPE_CONT, GFC_ARRAY_ASSUMED_RANK, GFC_ARRAY_ASSUMED_RANK_CONT, + GFC_ARRAY_ASSUMED_RANK_ALLOCATABLE, + GFC_ARRAY_ASSUMED_RANK_POINTER, + GFC_ARRAY_ASSUMED_RANK_POINTER_CONT, GFC_ARRAY_ALLOCATABLE, GFC_ARRAY_POINTER, GFC_ARRAY_POINTER_CONT |