aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-10-24 18:05:09 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-10-24 18:05:09 +0200
commitd168c883c5794b57adfb272e9fec9ee8df974832 (patch)
tree68e4a8ee8e9689454c1003d8db8354c74f86e610 /gcc/fortran/trans-array.c
parent4467029544b6d28433b81e91309d3b67c7cc4a7b (diff)
downloadgcc-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-array.c')
-rw-r--r--gcc/fortran/trans-array.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index c59e872..117349e 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2373,7 +2373,7 @@ trans_array_constructor (gfc_ss * ss, locus * where)
offsetvar, gfc_index_one_node);
tmp = gfc_evaluate_now (tmp, &outer_loop->pre);
gfc_conv_descriptor_ubound_set (&loop->pre, desc, gfc_rank_cst[0], tmp);
- if (*loop_ubound0 && TREE_CODE (*loop_ubound0) == VAR_DECL)
+ if (*loop_ubound0 && VAR_P (*loop_ubound0))
gfc_add_modify (&outer_loop->pre, *loop_ubound0, tmp);
else
*loop_ubound0 = tmp;
@@ -2860,7 +2860,7 @@ trans_array_bound_check (gfc_se * se, gfc_ss *ss, tree index, int n,
name = ss->info->expr->symtree->n.sym->name;
gcc_assert (name != NULL);
- if (TREE_CODE (descriptor) == VAR_DECL)
+ if (VAR_P (descriptor))
name = IDENTIFIER_POINTER (DECL_NAME (descriptor));
/* If upper bound is present, include both bounds in the error message. */
@@ -3104,7 +3104,7 @@ build_class_array_ref (gfc_se *se, tree base, tree index)
else
type = NULL_TREE;
}
- if (TREE_CODE (tmp) == VAR_DECL)
+ if (VAR_P (tmp))
break;
}
@@ -5096,8 +5096,9 @@ gfc_array_init_size (tree descriptor, int rank, int corank, tree * poffset,
/* Set the dtype before the alloc, because registration of coarrays needs
it initialized. */
- if (expr->ts.type == BT_CHARACTER && expr->ts.deferred
- && TREE_CODE (expr->ts.u.cl->backend_decl) == VAR_DECL)
+ if (expr->ts.type == BT_CHARACTER
+ && expr->ts.deferred
+ && VAR_P (expr->ts.u.cl->backend_decl))
{
type = gfc_typenode_for_spec (&expr->ts);
tmp = gfc_conv_descriptor_dtype (descriptor);
@@ -5968,7 +5969,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym,
/* Don't actually allocate space for Cray Pointees. */
if (sym->attr.cray_pointee)
{
- if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
+ if (VAR_P (GFC_TYPE_ARRAY_OFFSET (type)))
gfc_add_modify (&init, GFC_TYPE_ARRAY_OFFSET (type), offset);
gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
@@ -6001,7 +6002,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym,
}
/* Set offset of the array. */
- if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
+ if (VAR_P (GFC_TYPE_ARRAY_OFFSET (type)))
gfc_add_modify (&init, GFC_TYPE_ARRAY_OFFSET (type), offset);
/* Automatic arrays should not have initializers. */
@@ -6054,14 +6055,14 @@ gfc_trans_g77_array (gfc_symbol * sym, gfc_wrapped_block * block)
gfc_start_block (&init);
if (sym->ts.type == BT_CHARACTER
- && TREE_CODE (sym->ts.u.cl->backend_decl) == VAR_DECL)
+ && VAR_P (sym->ts.u.cl->backend_decl))
gfc_conv_string_length (sym->ts.u.cl, NULL, &init);
/* Evaluate the bounds of the array. */
gfc_trans_array_bounds (type, sym, &offset, &init);
/* Set the offset. */
- if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
+ if (VAR_P (GFC_TYPE_ARRAY_OFFSET (type)))
gfc_add_modify (&init, GFC_TYPE_ARRAY_OFFSET (type), offset);
/* Set the pointer itself if we aren't using the parameter directly. */
@@ -6160,7 +6161,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc,
gfc_start_block (&init);
if (sym->ts.type == BT_CHARACTER
- && TREE_CODE (sym->ts.u.cl->backend_decl) == VAR_DECL)
+ && VAR_P (sym->ts.u.cl->backend_decl))
gfc_conv_string_length (sym->ts.u.cl, NULL, &init);
checkparm = (as->type == AS_EXPLICIT
@@ -6384,7 +6385,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc,
gfc_trans_array_cobounds (type, &init, sym);
/* Set the offset. */
- if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
+ if (VAR_P (GFC_TYPE_ARRAY_OFFSET (type)))
gfc_add_modify (&init, GFC_TYPE_ARRAY_OFFSET (type), offset);
gfc_trans_vla_type_sizes (sym, &init);
@@ -8977,7 +8978,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
tmp = gfc_conv_descriptor_offset (desc);
gfc_add_modify (&fblock, tmp, offset);
if (linfo->saved_offset
- && TREE_CODE (linfo->saved_offset) == VAR_DECL)
+ && VAR_P (linfo->saved_offset))
gfc_add_modify (&fblock, linfo->saved_offset, tmp);
/* Now set the deltas for the lhs. */
@@ -8988,8 +8989,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
tmp = fold_build2_loc (input_location, MINUS_EXPR,
gfc_array_index_type, tmp,
loop->from[dim]);
- if (linfo->delta[dim]
- && TREE_CODE (linfo->delta[dim]) == VAR_DECL)
+ if (linfo->delta[dim] && VAR_P (linfo->delta[dim]))
gfc_add_modify (&fblock, linfo->delta[dim], tmp);
}
@@ -8998,7 +8998,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
{
if (expr2->ts.deferred)
{
- if (TREE_CODE (expr2->ts.u.cl->backend_decl) == VAR_DECL)
+ if (VAR_P (expr2->ts.u.cl->backend_decl))
tmp = expr2->ts.u.cl->backend_decl;
else
tmp = rss->info->string_length;
@@ -9016,7 +9016,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
}
if (expr1->ts.u.cl->backend_decl
- && TREE_CODE (expr1->ts.u.cl->backend_decl) == VAR_DECL)
+ && VAR_P (expr1->ts.u.cl->backend_decl))
gfc_add_modify (&fblock, expr1->ts.u.cl->backend_decl, tmp);
else
gfc_add_modify (&fblock, lss->info->string_length, tmp);
@@ -9182,8 +9182,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
gfc_add_expr_to_block (&fblock, tmp);
/* Make sure that the scalarizer data pointer is updated. */
- if (linfo->data
- && TREE_CODE (linfo->data) == VAR_DECL)
+ if (linfo->data && VAR_P (linfo->data))
{
tmp = gfc_conv_descriptor_data_get (desc);
gfc_add_modify (&fblock, linfo->data, tmp);
@@ -9227,8 +9226,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
gfc_set_backend_locus (&sym->declared_at);
gfc_init_block (&init);
- gcc_assert (TREE_CODE (sym->backend_decl) == VAR_DECL
- || TREE_CODE (sym->backend_decl) == PARM_DECL);
+ gcc_assert (VAR_P (sym->backend_decl)
+ || TREE_CODE (sym->backend_decl) == PARM_DECL);
if (sym->ts.type == BT_CHARACTER
&& !INTEGER_CST_P (sym->ts.u.cl->backend_decl))