Commit ec09945c by Kazu Hirata Committed by Kazu Hirata

* trans-expr.c: Remove trailing ^M.

From-SVN: r100359
parent 771e816b
2005-05-30 Kazu Hirata <kazu@cs.umass.edu>
* trans-expr.c: Remove trailing ^M.
2005-05-29 Janne Blomqvist <jblomqvi@vipunen.hut.fi> 2005-05-29 Janne Blomqvist <jblomqvi@vipunen.hut.fi>
Steven G. Kargl <kargls@comcast.net> Steven G. Kargl <kargls@comcast.net>
......
...@@ -354,43 +354,43 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) ...@@ -354,43 +354,43 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
se->expr = gfc_build_addr_expr (NULL, se->expr); se->expr = gfc_build_addr_expr (NULL, se->expr);
} }
return; return;
} }
/* Dereference the expression, where needed. Since characters /* Dereference the expression, where needed. Since characters
are entirely different from other types, they are treated are entirely different from other types, they are treated
separately. */ separately. */
if (sym->ts.type == BT_CHARACTER) if (sym->ts.type == BT_CHARACTER)
{ {
/* Dereference character pointer dummy arguments /* Dereference character pointer dummy arguments
or results. */ or results. */
if ((sym->attr.pointer || sym->attr.allocatable) if ((sym->attr.pointer || sym->attr.allocatable)
&& ((sym->attr.dummy) && ((sym->attr.dummy)
|| (sym->attr.function || (sym->attr.function
|| sym->attr.result))) || sym->attr.result)))
se->expr = gfc_build_indirect_ref (se->expr); se->expr = gfc_build_indirect_ref (se->expr);
} }
else else
{ {
/* Dereference non-charcter scalar dummy arguments. */ /* Dereference non-charcter scalar dummy arguments. */
if ((sym->attr.dummy) && (!sym->attr.dimension)) if ((sym->attr.dummy) && (!sym->attr.dimension))
se->expr = gfc_build_indirect_ref (se->expr); se->expr = gfc_build_indirect_ref (se->expr);
/* Dereference scalar hidden result. */ /* Dereference scalar hidden result. */
if ((gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX) if ((gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX)
&& (sym->attr.function || sym->attr.result) && (sym->attr.function || sym->attr.result)
&& (!sym->attr.dimension)) && (!sym->attr.dimension))
se->expr = gfc_build_indirect_ref (se->expr); se->expr = gfc_build_indirect_ref (se->expr);
/* Dereference non-character pointer variables. /* Dereference non-character pointer variables.
These must be dummys or results or scalars. */ These must be dummys or results or scalars. */
if ((sym->attr.pointer || sym->attr.allocatable) if ((sym->attr.pointer || sym->attr.allocatable)
&& ((sym->attr.dummy) && ((sym->attr.dummy)
|| (sym->attr.function || sym->attr.result) || (sym->attr.function || sym->attr.result)
|| (!sym->attr.dimension))) || (!sym->attr.dimension)))
se->expr = gfc_build_indirect_ref (se->expr); se->expr = gfc_build_indirect_ref (se->expr);
} }
ref = expr->ref; ref = expr->ref;
} }
...@@ -1136,8 +1136,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1136,8 +1136,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
if (se->direct_byref) if (se->direct_byref)
{ {
arglist = gfc_chainon_list (arglist, se->expr); arglist = gfc_chainon_list (arglist, se->expr);
/* Add string length to argument list. */ /* Add string length to argument list. */
if (sym->ts.type == BT_CHARACTER) if (sym->ts.type == BT_CHARACTER)
{ {
sym->ts.cl->backend_decl = len; sym->ts.cl->backend_decl = len;
...@@ -1147,11 +1147,11 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1147,11 +1147,11 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
} }
else if (sym->result->attr.dimension) else if (sym->result->attr.dimension)
{ {
gcc_assert (se->loop && se->ss); gcc_assert (se->loop && se->ss);
/* Set the type of the array. */ /* Set the type of the array. */
tmp = gfc_typenode_for_spec (&sym->ts); tmp = gfc_typenode_for_spec (&sym->ts);
info->dimen = se->loop->dimen; info->dimen = se->loop->dimen;
/* Allocate a temporary to store the result. */ /* Allocate a temporary to store the result. */
gfc_trans_allocate_temp_array (se->loop, info, tmp); gfc_trans_allocate_temp_array (se->loop, info, tmp);
...@@ -1161,7 +1161,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1161,7 +1161,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
gfc_conv_descriptor_stride (info->descriptor, gfc_rank_cst[0]); gfc_conv_descriptor_stride (info->descriptor, gfc_rank_cst[0]);
gfc_add_modify_expr (&se->pre, tmp, gfc_add_modify_expr (&se->pre, tmp,
convert (TREE_TYPE (tmp), integer_zero_node)); convert (TREE_TYPE (tmp), integer_zero_node));
/* Pass the temporary as the first argument. */ /* Pass the temporary as the first argument. */
tmp = info->descriptor; tmp = info->descriptor;
tmp = gfc_build_addr_expr (NULL, tmp); tmp = gfc_build_addr_expr (NULL, tmp);
...@@ -1178,8 +1178,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1178,8 +1178,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
} }
else if (sym->ts.type == BT_CHARACTER) else if (sym->ts.type == BT_CHARACTER)
{ {
/* Pass the string length. */ /* Pass the string length. */
sym->ts.cl->backend_decl = len; sym->ts.cl->backend_decl = len;
type = gfc_get_character_type (sym->ts.kind, sym->ts.cl); type = gfc_get_character_type (sym->ts.kind, sym->ts.cl);
type = build_pointer_type (type); type = build_pointer_type (type);
...@@ -1188,18 +1188,18 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1188,18 +1188,18 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
if (sym->attr.pointer || sym->attr.allocatable) if (sym->attr.pointer || sym->attr.allocatable)
{ {
/* Build char[4] * pstr. */ /* Build char[4] * pstr. */
tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node, len, tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node, len,
convert (gfc_charlen_type_node, integer_one_node)); convert (gfc_charlen_type_node, integer_one_node));
tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp); tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp);
tmp = build_array_type (gfc_character1_type_node, tmp); tmp = build_array_type (gfc_character1_type_node, tmp);
var = gfc_create_var (build_pointer_type (tmp), "pstr"); var = gfc_create_var (build_pointer_type (tmp), "pstr");
/* Provide an address expression for the function arguments. */ /* Provide an address expression for the function arguments. */
var = gfc_build_addr_expr (NULL, var); var = gfc_build_addr_expr (NULL, var);
} }
else else
{ {
var = gfc_conv_string_tmp (se, type, len); var = gfc_conv_string_tmp (se, type, len);
} }
arglist = gfc_chainon_list (arglist, var); arglist = gfc_chainon_list (arglist, var);
arglist = gfc_chainon_list (arglist, arglist = gfc_chainon_list (arglist,
...@@ -1364,11 +1364,11 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1364,11 +1364,11 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
se->string_length = len; se->string_length = len;
} }
else if (sym->ts.type == BT_CHARACTER) else if (sym->ts.type == BT_CHARACTER)
{ {
/* Dereference for character pointer results. */ /* Dereference for character pointer results. */
if (sym->attr.pointer || sym->attr.allocatable) if (sym->attr.pointer || sym->attr.allocatable)
se->expr = gfc_build_indirect_ref (var); se->expr = gfc_build_indirect_ref (var);
else else
se->expr = var; se->expr = var;
se->string_length = len; se->string_length = len;
...@@ -2297,7 +2297,7 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2) ...@@ -2297,7 +2297,7 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2)
} }
else else
gfc_conv_expr (&lse, expr1); gfc_conv_expr (&lse, expr1);
tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts.type); tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts.type);
gfc_add_expr_to_block (&body, tmp); gfc_add_expr_to_block (&body, tmp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment