From d42844f1fadda7cb8bf37a104d57f4f0e0302a1f Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 19 Jun 2016 12:38:16 +0200 Subject: [PATCH] Use gfc_add_*_component defines where appropriate A couple of places used gfc_add_component_ref(expr, "string") instead of the defines from gfortran.h From-SVN: r237580 --- gcc/fortran/ChangeLog | 12 ++++++++++++ gcc/fortran/class.c | 4 ++-- gcc/fortran/trans-intrinsic.c | 2 +- gcc/fortran/trans.c | 4 ++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c7244846ce2..d1f384ecc14 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,15 @@ +2016-06-19 Bernhard Reutner-Fischer + + * class.c (gfc_add_class_array_ref): Call gfc_add_data_component() + instead of gfc_add_component_ref(). + (gfc_get_len_component): Call gfc_add_len_component() instead of + gfc_add_component_ref(). + * trans-intrinsic.c (gfc_conv_intrinsic_loc): Call + gfc_add_data_component() instead of gfc_add_component_ref(). + * trans.c (gfc_add_finalizer_call): Call + gfc_add_final_component() and gfc_add_size_component() instead + of gfc_add_component_ref. + 2016-06-18 Bernhard Reutner-Fischer * trans-types.c (gfc_typenode_for_spec): Commentary typo fix. diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 3627828d21f..a627448529e 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -257,7 +257,7 @@ gfc_add_class_array_ref (gfc_expr *e) int rank = CLASS_DATA (e)->as->rank; gfc_array_spec *as = CLASS_DATA (e)->as; gfc_ref *ref = NULL; - gfc_add_component_ref (e, "_data"); + gfc_add_data_component (e); e->rank = rank; for (ref = e->ref; ref; ref = ref->next) if (!ref->next) @@ -582,7 +582,7 @@ gfc_get_len_component (gfc_expr *e) ref = ref->next; } /* And replace if with a ref to the _len component. */ - gfc_add_component_ref (ptr, "_len"); + gfc_add_len_component (ptr); return ptr; } diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 1aaf4e256bb..574300eabb5 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -7137,7 +7137,7 @@ gfc_conv_intrinsic_loc (gfc_se * se, gfc_expr * expr) if (arg_expr->rank == 0) { if (arg_expr->ts.type == BT_CLASS) - gfc_add_component_ref (arg_expr, "_data"); + gfc_add_data_component (arg_expr); gfc_conv_expr_reference (se, arg_expr); } else diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index d6b4a564bf5..28d1341cc7e 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -1148,11 +1148,11 @@ gfc_add_finalizer_call (stmtblock_t *block, gfc_expr *expr2) final_expr = gfc_copy_expr (expr); gfc_add_vptr_component (final_expr); - gfc_add_component_ref (final_expr, "_final"); + gfc_add_final_component (final_expr); elem_size = gfc_copy_expr (expr); gfc_add_vptr_component (elem_size); - gfc_add_component_ref (elem_size, "_size"); + gfc_add_size_component (elem_size); } gcc_assert (final_expr->expr_type == EXPR_VARIABLE); -- 2.11.4.GIT