https://gcc.gnu.org/g:df25c9c8e718ffd032390f3d279757e191b49849

commit df25c9c8e718ffd032390f3d279757e191b49849
Author: Mikael Morin <[email protected]>
Date:   Fri Jul 24 17:25:00 2026 +0200

    Déplacement gfc_init_static_descriptor

Diff:
---
 gcc/fortran/trans-descriptor.cc | 72 ++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index d4018860828a..9608fff9a56c 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -717,6 +717,42 @@ gfc_build_null_descriptor (tree type)
 }
 
 
+void
+gfc_init_static_descriptor (gfc_symbol *sym)
+{
+  vec<constructor_elt, va_gc> *v = NULL;
+
+  tree descr = sym->backend_decl;
+  tree type = TREE_TYPE (descr);
+
+  gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
+  tree fields = TYPE_FIELDS (type);
+
+  tree data_field = gfc_advance_chain (fields, DATA_FIELD);
+  CONSTRUCTOR_APPEND_ELT (v, data_field,
+                         fold_convert (TREE_TYPE (data_field),
+                                       null_pointer_node));
+
+  gfc_array_spec *as;
+  if (sym->ts.type == BT_CLASS)
+    as = CLASS_DATA (sym)->as;
+  else
+    as = sym->as;
+
+  int rank = as ? as->rank : 0;
+  tree dtype_field = gfc_advance_chain (fields, DTYPE_FIELD);
+  tree dtype_value = gfc_get_dtype_rank_type (rank,
+                                             gfc_get_element_type (type));
+  CONSTRUCTOR_APPEND_ELT (v, dtype_field,
+                         fold_convert (TREE_TYPE (dtype_field), dtype_value));
+
+  tree constr = build_constructor (type, v);
+  TREE_CONSTANT (constr) = 1;
+
+  DECL_INITIAL (descr) = constr;
+}
+
+
 /* Cleanup those #defines.  */
 
 #undef DATA_FIELD
@@ -979,42 +1015,6 @@ gfc_init_absent_descriptor (stmtblock_t *block, tree 
descr)
 }
 
 
-void
-gfc_init_static_descriptor (gfc_symbol *sym)
-{
-  vec<constructor_elt, va_gc> *v = NULL;
-
-  tree descr = sym->backend_decl;
-  tree type = TREE_TYPE (descr);
-
-  gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
-  tree fields = TYPE_FIELDS (type);
-
-  tree data_field = gfc_advance_chain (fields, DATA_FIELD);
-  CONSTRUCTOR_APPEND_ELT (v, data_field,
-                         fold_convert (TREE_TYPE (data_field),
-                                       null_pointer_node));
-
-  gfc_array_spec *as;
-  if (sym->ts.type == BT_CLASS)
-    as = CLASS_DATA (sym)->as;
-  else
-    as = sym->as;
-
-  int rank = as ? as->rank : 0;
-  tree dtype_field = gfc_advance_chain (fields, DTYPE_FIELD);
-  tree dtype_value = gfc_get_dtype_rank_type (rank,
-                                             gfc_get_element_type (type));
-  CONSTRUCTOR_APPEND_ELT (v, dtype_field,
-                         fold_convert (TREE_TYPE (dtype_field), dtype_value));
-
-  tree constr = build_constructor (type, v);
-  TREE_CONSTANT (constr) = 1;
-
-  DECL_INITIAL (descr) = constr;
-}
-
-
 void
 gfc_nullify_descriptor (stmtblock_t *block, gfc_symbol *sym, gfc_expr *expr,
                        tree descr, tree string_length)

Reply via email to