aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2004-08-25 17:50:36 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2004-08-25 17:50:36 +0200
commit923ab88cb2f07d36569c71cf53f8a0529ca1c2d4 (patch)
tree9edb54600069aa62a022452e36d5e099d7183bf8 /gcc/fortran/trans-expr.c
parent905af9e968a904475e846afc73cc3cf07c5b359a (diff)
downloadgcc-923ab88cb2f07d36569c71cf53f8a0529ca1c2d4.zip
gcc-923ab88cb2f07d36569c71cf53f8a0529ca1c2d4.tar.gz
gcc-923ab88cb2f07d36569c71cf53f8a0529ca1c2d4.tar.bz2
trans.h (build2_v, build3_v): New macros.
* trans.h (build2_v, build3_v): New macros. (build_v): Remove. * f95-lang.c (gfc_truthvalue_conversion): Use build2 instead of build. * trans-array.c (gfc_conv_descriptor_data, gfc_conv_descriptor_offset, gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride, gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound, gfc_trans_allocate_array_storage, gfc_trans_allocate_temp_array, gfc_trans_array_constructor_subarray, gfc_trans_array_constructor_value, gfc_conv_array_index_ref, gfc_trans_array_bound_check, gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref, gfc_conv_array_ref, gfc_conv_array_ref, gfc_trans_preloop_setup, gfc_trans_scalarized_loop_end, gfc_conv_ss_startstride, gfc_conv_loop_setup, gfc_array_init_size, gfc_conv_array_initializer, gfc_trans_array_bounds, gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias, gfc_conv_expr_descriptor, gfc_conv_array_parameter, gfc_trans_deferred_array): Use buildN and buildN_v macros instead of build and build_v as appropriate. * trans-common.c (create_common): Same. * trans-decl.c (gfc_trans_auto_character_variable, gfc_trans_entry_master_switch, gfc_generate_function_code): Same. * trans-expr.c (gfc_conv_expr_present, gfc_conv_substring, gfc_conv_component_ref, gfc_conv_unary_op, gfc_conv_powi, gfc_conv_cst_int_power, gfc_conv_string_tmp, gfc_conv_concat_op, gfc_conv_expr_op, gfc_conv_function_call, gfc_trans_structure_assign): Same. * trans-intrinsic.c (build_fixbound_expr, build_round_expr, gfc_conv_intrinsic_aint, gfc_conv_intrinsic_bound, gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_mod, gfc_conv_intrinsic_dim, gfc_conv_intrinsic_sign, gfc_conv_intrinsic_dprod, gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_anyall, gfc_conv_intrinsic_count, gfc_conv_intrinsic_arith, gfc_conv_intrinsic_minmaxloc, gfc_conv_intrinsic_minmaxval, gfc_conv_intrinsic_btest, gfc_conv_intrinsic_bitop, gfc_conv_intrinsic_singlebitop, gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_ishft, gfc_conv_intrinsic_merge, gfc_conv_intrinsic_strcmp, gfc_conv_allocated, gfc_conv_associated, prepare_arg_info, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_trim, gfc_conv_intrinsic_repeat, gfc_conv_intrinsic_iargc): Same. * trans-io.c (set_parameter_value, set_parameter_ref, set_string, set_flag, add_case, io_result, transfer_namelist_element, transfer_expr): Same. * trans-stmt.c (gfc_trans_goto, gfc_trans_return, gfc_trans_if_1, gfc_trans_arithmetic_if, gfc_trans_do, gfc_trans_do_while, gfc_trans_integer_select, gfc_trans_logical_select, gfc_trans_character_select, gfc_trans_forall_loop, gfc_trans_nested_forall_loop, gfc_do_allocate, generate_loop_for_temp_to_lhs, generate_loop_for_rhs_to_temp, compute_inner_temp_size, compute_overall_iter_number, allocate_temp_for_forall_nest, gfc_trans_pointer_assign_need_temp, gfc_trans_forall_1, gfc_evaluate_where_mask, gfc_trans_where_assign, gfc_trans_allocate): Same. * trans-types.c (gfc_get_dtype, gfc_get_array_type_bounds): Same. * trans.c (gfc_add_modify_expr, gfc_finish_block, gfc_build_array_ref, gfc_build_function_call, gfc_trans_runtime_check): Same. From-SVN: r86554
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 127a820..50aa9ca 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -136,8 +136,8 @@ gfc_conv_expr_present (gfc_symbol * sym)
|| GFC_ARRAY_TYPE_P (TREE_TYPE (decl)));
decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
}
- return build (NE_EXPR, boolean_type_node, decl,
- fold_convert (TREE_TYPE (decl), null_pointer_node));
+ return build2 (NE_EXPR, boolean_type_node, decl,
+ fold_convert (TREE_TYPE (decl), null_pointer_node));
}
@@ -199,10 +199,10 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind)
gfc_add_block_to_block (&se->pre, &end.pre);
}
tmp =
- build (MINUS_EXPR, gfc_strlen_type_node,
- fold_convert (gfc_strlen_type_node, integer_one_node),
- start.expr);
- tmp = build (PLUS_EXPR, gfc_strlen_type_node, end.expr, tmp);
+ build2 (MINUS_EXPR, gfc_strlen_type_node,
+ fold_convert (gfc_strlen_type_node, integer_one_node),
+ start.expr);
+ tmp = build2 (PLUS_EXPR, gfc_strlen_type_node, end.expr, tmp);
se->string_length = fold (tmp);
}
@@ -224,7 +224,7 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref)
field = c->backend_decl;
assert (TREE_CODE (field) == FIELD_DECL);
decl = se->expr;
- tmp = build (COMPONENT_REF, TREE_TYPE (field), decl, field, NULL_TREE);
+ tmp = build3 (COMPONENT_REF, TREE_TYPE (field), decl, field, NULL_TREE);
se->expr = tmp;
@@ -379,8 +379,8 @@ gfc_conv_unary_op (enum tree_code code, gfc_se * se, gfc_expr * expr)
We must convert it to a compare to 0 (e.g. EQ_EXPR (op1, 0)).
All other unary operators have an equivalent GIMPLE unary operator. */
if (code == TRUTH_NOT_EXPR)
- se->expr = build (EQ_EXPR, type, operand.expr,
- convert (type, integer_zero_node));
+ se->expr = build2 (EQ_EXPR, type, operand.expr,
+ convert (type, integer_zero_node));
else
se->expr = build1 (code, type, operand.expr);
@@ -469,7 +469,7 @@ gfc_conv_powi (gfc_se * se, int n, tree * tmpvar)
op1 = op0;
}
- tmp = fold (build (MULT_EXPR, TREE_TYPE (op0), op0, op1));
+ tmp = fold (build2 (MULT_EXPR, TREE_TYPE (op0), op0, op1));
tmp = gfc_evaluate_now (tmp, &se->pre);
if (n < POWI_TABLE_SIZE)
@@ -508,29 +508,29 @@ gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs)
/* If rhs < 0 and lhs is an integer, the result is -1, 0 or 1. */
if ((sgn == -1) && (TREE_CODE (type) == INTEGER_TYPE))
{
- tmp = build (EQ_EXPR, boolean_type_node, lhs,
- fold_convert (TREE_TYPE (lhs), integer_minus_one_node));
- cond = build (EQ_EXPR, boolean_type_node, lhs,
- convert (TREE_TYPE (lhs), integer_one_node));
+ tmp = build2 (EQ_EXPR, boolean_type_node, lhs,
+ fold_convert (TREE_TYPE (lhs), integer_minus_one_node));
+ cond = build2 (EQ_EXPR, boolean_type_node, lhs,
+ convert (TREE_TYPE (lhs), integer_one_node));
/* If rhs is even,
result = (lhs == 1 || lhs == -1) ? 1 : 0. */
if ((n & 1) == 0)
{
- tmp = build (TRUTH_OR_EXPR, boolean_type_node, tmp, cond);
- se->expr = build (COND_EXPR, type, tmp,
- convert (type, integer_one_node),
- convert (type, integer_zero_node));
+ tmp = build2 (TRUTH_OR_EXPR, boolean_type_node, tmp, cond);
+ se->expr = build3 (COND_EXPR, type, tmp,
+ convert (type, integer_one_node),
+ convert (type, integer_zero_node));
return 1;
}
/* If rhs is odd,
result = (lhs == 1) ? 1 : (lhs == -1) ? -1 : 0. */
- tmp = build (COND_EXPR, type, tmp,
- convert (type, integer_minus_one_node),
- convert (type, integer_zero_node));
- se->expr = build (COND_EXPR, type, cond,
- convert (type, integer_one_node),
- tmp);
+ tmp = build3 (COND_EXPR, type, tmp,
+ convert (type, integer_minus_one_node),
+ convert (type, integer_zero_node));
+ se->expr = build3 (COND_EXPR, type, cond,
+ convert (type, integer_one_node),
+ tmp);
return 1;
}
@@ -539,7 +539,7 @@ gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs)
if (sgn == -1)
{
tmp = gfc_build_const (type, integer_one_node);
- vartmp[1] = build (RDIV_EXPR, type, tmp, vartmp[1]);
+ vartmp[1] = build2 (RDIV_EXPR, type, tmp, vartmp[1]);
}
se->expr = gfc_conv_powi (se, n, vartmp);
@@ -691,9 +691,9 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
if (gfc_can_put_var_on_stack (len))
{
/* Create a temporary variable to hold the result. */
- tmp = fold (build (MINUS_EXPR, gfc_strlen_type_node, len,
- convert (gfc_strlen_type_node,
- integer_one_node)));
+ tmp = fold (build2 (MINUS_EXPR, gfc_strlen_type_node, len,
+ convert (gfc_strlen_type_node,
+ integer_one_node)));
tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp);
tmp = build_array_type (gfc_character1_type_node, tmp);
var = gfc_create_var (tmp, "str");
@@ -750,8 +750,8 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr)
len = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
if (len == NULL_TREE)
{
- len = fold (build (PLUS_EXPR, TREE_TYPE (lse.string_length),
- lse.string_length, rse.string_length));
+ len = fold (build2 (PLUS_EXPR, TREE_TYPE (lse.string_length),
+ lse.string_length, rse.string_length));
}
type = build_pointer_type (type);
@@ -944,11 +944,11 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
if (lop)
{
/* The result of logical ops is always boolean_type_node. */
- tmp = fold (build (code, type, lse.expr, rse.expr));
+ tmp = fold (build2 (code, type, lse.expr, rse.expr));
se->expr = convert (type, tmp);
}
else
- se->expr = fold (build (code, type, lse.expr, rse.expr));
+ se->expr = fold (build2 (code, type, lse.expr, rse.expr));
/* Add the post blocks. */
gfc_add_block_to_block (&se->post, &rse.post);
@@ -1167,8 +1167,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr))) = integer_type_node;
fntype = TREE_TYPE (TREE_TYPE (se->expr));
- se->expr = build (CALL_EXPR, TREE_TYPE (fntype), se->expr,
- arglist, NULL_TREE);
+ se->expr = build3 (CALL_EXPR, TREE_TYPE (fntype), se->expr,
+ arglist, NULL_TREE);
/* A pure function may still have side-effects - it may modify its
parameters. */
@@ -1193,7 +1193,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
/* Check the data pointer hasn't been modified. This would
happen in a function returning a pointer. */
tmp = gfc_conv_descriptor_data (info->descriptor);
- tmp = build (NE_EXPR, boolean_type_node, tmp, info->data);
+ tmp = build2 (NE_EXPR, boolean_type_node, tmp, info->data);
gfc_trans_runtime_check (tmp, gfc_strconst_fault, &se->pre);
}
se->expr = info->descriptor;
@@ -1617,7 +1617,7 @@ gfc_trans_structure_assign (tree dest, gfc_expr * expr)
continue;
field = cm->backend_decl;
- tmp = build (COMPONENT_REF, TREE_TYPE (field), dest, field, NULL_TREE);
+ tmp = build3 (COMPONENT_REF, TREE_TYPE (field), dest, field, NULL_TREE);
tmp = gfc_trans_subcomponent_assign (tmp, cm, c->expr);
gfc_add_expr_to_block (&block, tmp);
}