diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-24 18:05:09 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-24 18:05:09 +0200 |
commit | d168c883c5794b57adfb272e9fec9ee8df974832 (patch) | |
tree | 68e4a8ee8e9689454c1003d8db8354c74f86e610 /gcc/fortran/trans-expr.c | |
parent | 4467029544b6d28433b81e91309d3b67c7cc4a7b (diff) | |
download | gcc-d168c883c5794b57adfb272e9fec9ee8df974832.zip gcc-d168c883c5794b57adfb272e9fec9ee8df974832.tar.gz gcc-d168c883c5794b57adfb272e9fec9ee8df974832.tar.bz2 |
trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use VAR_P (x) instead of TREE_CODE (x) == VAR_DECL.
* trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use VAR_P (x)
instead of TREE_CODE (x) == VAR_DECL.
* trans-expr.c (gfc_class_vptr_get, gfc_class_len_get,
gfc_class_len_or_zero_get, gfc_get_vptr_from_expr,
gfc_conv_string_length, conv_base_obj_fcn_val,
gfc_conv_procedure_call, gfc_trans_assignment_1): Likewise.
* trans-openmp.c (gfc_omp_predetermined_sharing,
gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause,
gfc_trans_omp_atomic, gfc_trans_omp_do): Likewise.
* trans-io.c (nml_get_addr_expr): Likewise.
* trans-decl.c (gfc_finish_decl, gfc_build_qualified_array,
gfc_get_symbol_decl, gfc_get_fake_result_decl,
gfc_trans_deferred_vars, gfc_trans_use_stmts,
generate_local_decl): Likewise.
* trans-array.c (trans_array_constructor, trans_array_bound_check,
build_class_array_ref, gfc_array_init_size,
gfc_trans_auto_array_allocation, gfc_trans_g77_array,
gfc_trans_dummy_array_bias, gfc_alloc_allocatable_for_assignment,
gfc_trans_deferred_array): Likewise.
* trans.c (gfc_build_array_ref): Likewise. Use
VAR_OR_FUNCTION_DECL_P (x) instead of TREE_CODE (x) == VAR_DECL
|| TREE_CODE (x) == FUNCTION_DECL.
From-SVN: r241482
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index fc03a23..525bb67 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -198,7 +198,7 @@ gfc_class_vptr_get (tree decl) tree vptr; /* For class arrays decl may be a temporary descriptor handle, the vptr is then available through the saved descriptor. */ - if (TREE_CODE (decl) == VAR_DECL && DECL_LANG_SPECIFIC (decl) + if (VAR_P (decl) && DECL_LANG_SPECIFIC (decl) && GFC_DECL_SAVED_DESCRIPTOR (decl)) decl = GFC_DECL_SAVED_DESCRIPTOR (decl); if (POINTER_TYPE_P (TREE_TYPE (decl))) @@ -217,7 +217,7 @@ gfc_class_len_get (tree decl) tree len; /* For class arrays decl may be a temporary descriptor handle, the len is then available through the saved descriptor. */ - if (TREE_CODE (decl) == VAR_DECL && DECL_LANG_SPECIFIC (decl) + if (VAR_P (decl) && DECL_LANG_SPECIFIC (decl) && GFC_DECL_SAVED_DESCRIPTOR (decl)) decl = GFC_DECL_SAVED_DESCRIPTOR (decl); if (POINTER_TYPE_P (TREE_TYPE (decl))) @@ -239,7 +239,7 @@ gfc_class_len_or_zero_get (tree decl) tree len; /* For class arrays decl may be a temporary descriptor handle, the vptr is then available through the saved descriptor. */ - if (TREE_CODE (decl) == VAR_DECL && DECL_LANG_SPECIFIC (decl) + if (VAR_P (decl) && DECL_LANG_SPECIFIC (decl) && GFC_DECL_SAVED_DESCRIPTOR (decl)) decl = GFC_DECL_SAVED_DESCRIPTOR (decl); if (POINTER_TYPE_P (TREE_TYPE (decl))) @@ -485,8 +485,7 @@ gfc_get_vptr_from_expr (tree expr) else type = NULL_TREE; } - if (TREE_CODE (tmp) == VAR_DECL - || TREE_CODE (tmp) == PARM_DECL) + if (VAR_P (tmp) || TREE_CODE (tmp) == PARM_DECL) break; } @@ -2160,9 +2159,7 @@ gfc_conv_string_length (gfc_charlen * cl, gfc_expr * expr, stmtblock_t * pblock) gfc_init_se (&se, NULL); - if (!cl->length - && cl->backend_decl - && TREE_CODE (cl->backend_decl) == VAR_DECL) + if (!cl->length && cl->backend_decl && VAR_P (cl->backend_decl)) return; /* If cl->length is NULL, use gfc_conv_expr to obtain the string length but @@ -3664,7 +3661,7 @@ conv_base_obj_fcn_val (gfc_se * se, tree base_object, gfc_expr * expr) gfc_ref *ref; tree var; - if (TREE_CODE (base_object) != VAR_DECL) + if (!VAR_P (base_object)) { var = gfc_create_var (TREE_TYPE (base_object), NULL); gfc_add_modify (&se->pre, var, base_object); @@ -5675,8 +5672,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, else { tmp = parmse.string_length; - if (TREE_CODE (tmp) != VAR_DECL - && TREE_CODE (tmp) != COMPONENT_REF) + if (!VAR_P (tmp) && TREE_CODE (tmp) != COMPONENT_REF) tmp = gfc_evaluate_now (parmse.string_length, &se->pre); parmse.string_length = gfc_build_addr_expr (NULL_TREE, tmp); } @@ -6019,7 +6015,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, if (ts.type == BT_CHARACTER && ts.deferred) { tmp = len; - if (TREE_CODE (tmp) != VAR_DECL) + if (!VAR_P (tmp)) tmp = gfc_evaluate_now (len, &se->pre); TREE_STATIC (tmp) = 1; gfc_add_modify (&se->pre, tmp, @@ -9692,7 +9688,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, /* Stabilize a string length for temporaries. */ if (expr2->ts.type == BT_CHARACTER && !expr1->ts.deferred - && !(TREE_CODE (rse.string_length) == VAR_DECL + && !(VAR_P (rse.string_length) || TREE_CODE (rse.string_length) == PARM_DECL || TREE_CODE (rse.string_length) == INDIRECT_REF)) string_length = gfc_evaluate_now (rse.string_length, &rse.pre); |