Commit dec131b6 by Mikael Morin

trans-array.c (gfc_walk_elemental_function_args, [...]): Move call to…

trans-array.c (gfc_walk_elemental_function_args, [...]): Move call to gfc_get_proc_ifc_for_expr out of gfc_walk_elemental_function_args.

	* trans-array.c (gfc_walk_elemental_function_args,
	gfc_walk_function_expr): Move call to gfc_get_proc_ifc_for_expr out
	of gfc_walk_elemental_function_args.
	* trans-stmt.c (gfc_trans_call): Ditto.
	* trans-array.h (gfc_get_proc_ifc_for_expr): New prototype.
	(gfc_walk_elemental_function_args): Update prototype.

From-SVN: r184141
parent 3e4c9843
2012-02-12 Mikael Morin <mikael@gcc.gnu.org> 2012-02-12 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_walk_elemental_function_args,
gfc_walk_function_expr): Move call to gfc_get_proc_ifc_for_expr out
of gfc_walk_elemental_function_args.
* trans-stmt.c (gfc_trans_call): Ditto.
* trans-array.h (gfc_get_proc_ifc_for_expr): New prototype.
(gfc_walk_elemental_function_args): Update prototype.
2012-02-12 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_get_proc_ifc_for_expr): New function. * trans-array.c (gfc_get_proc_ifc_for_expr): New function.
(gfc_walk_elemental_function_args): Move code to (gfc_walk_elemental_function_args): Move code to
gfc_get_proc_ifc_for_expr and call it. gfc_get_proc_ifc_for_expr and call it.
......
...@@ -8463,9 +8463,8 @@ gfc_get_proc_ifc_for_expr (gfc_expr *procedure_ref) ...@@ -8463,9 +8463,8 @@ gfc_get_proc_ifc_for_expr (gfc_expr *procedure_ref)
gfc_ss * gfc_ss *
gfc_walk_elemental_function_args (gfc_ss * ss, gfc_actual_arglist *arg, gfc_walk_elemental_function_args (gfc_ss * ss, gfc_actual_arglist *arg,
gfc_expr *proc_expr, gfc_ss_type type) gfc_symbol *proc_ifc, gfc_ss_type type)
{ {
gfc_symbol *proc_ifc;
gfc_formal_arglist *dummy_arg; gfc_formal_arglist *dummy_arg;
int scalar; int scalar;
gfc_ss *head; gfc_ss *head;
...@@ -8475,7 +8474,6 @@ gfc_walk_elemental_function_args (gfc_ss * ss, gfc_actual_arglist *arg, ...@@ -8475,7 +8474,6 @@ gfc_walk_elemental_function_args (gfc_ss * ss, gfc_actual_arglist *arg,
head = gfc_ss_terminator; head = gfc_ss_terminator;
tail = NULL; tail = NULL;
proc_ifc = gfc_get_proc_ifc_for_expr (proc_expr);
if (proc_ifc) if (proc_ifc)
dummy_arg = proc_ifc->formal; dummy_arg = proc_ifc->formal;
else else
...@@ -8565,7 +8563,8 @@ gfc_walk_function_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -8565,7 +8563,8 @@ gfc_walk_function_expr (gfc_ss * ss, gfc_expr * expr)
by reference. */ by reference. */
if (sym->attr.elemental || (comp && comp->attr.elemental)) if (sym->attr.elemental || (comp && comp->attr.elemental))
return gfc_walk_elemental_function_args (ss, expr->value.function.actual, return gfc_walk_elemental_function_args (ss, expr->value.function.actual,
expr, GFC_SS_REFERENCE); gfc_get_proc_ifc_for_expr (expr),
GFC_SS_REFERENCE);
/* Scalar functions are OK as these are evaluated outside the scalarization /* Scalar functions are OK as these are evaluated outside the scalarization
loop. Pass back and let the caller deal with it. */ loop. Pass back and let the caller deal with it. */
......
...@@ -66,6 +66,8 @@ void gfc_trans_deferred_array (gfc_symbol *, gfc_wrapped_block *); ...@@ -66,6 +66,8 @@ void gfc_trans_deferred_array (gfc_symbol *, gfc_wrapped_block *);
/* Generate an initializer for a static pointer or allocatable array. */ /* Generate an initializer for a static pointer or allocatable array. */
void gfc_trans_static_array_pointer (gfc_symbol *); void gfc_trans_static_array_pointer (gfc_symbol *);
/* Get the procedure interface for a function call. */
gfc_symbol *gfc_get_proc_ifc_for_expr (gfc_expr *);
/* Generate scalarization information for an expression. */ /* Generate scalarization information for an expression. */
gfc_ss *gfc_walk_expr (gfc_expr *); gfc_ss *gfc_walk_expr (gfc_expr *);
/* Workhorse for gfc_walk_expr. */ /* Workhorse for gfc_walk_expr. */
...@@ -74,7 +76,7 @@ gfc_ss *gfc_walk_subexpr (gfc_ss *, gfc_expr *); ...@@ -74,7 +76,7 @@ gfc_ss *gfc_walk_subexpr (gfc_ss *, gfc_expr *);
gfc_ss *gfc_walk_array_ref (gfc_ss *, gfc_expr *, gfc_ref * ref); gfc_ss *gfc_walk_array_ref (gfc_ss *, gfc_expr *, gfc_ref * ref);
/* Walk the arguments of an elemental function. */ /* Walk the arguments of an elemental function. */
gfc_ss *gfc_walk_elemental_function_args (gfc_ss *, gfc_actual_arglist *, gfc_ss *gfc_walk_elemental_function_args (gfc_ss *, gfc_actual_arglist *,
gfc_expr *, gfc_ss_type); gfc_symbol *, gfc_ss_type);
/* Walk an intrinsic function. */ /* Walk an intrinsic function. */
gfc_ss *gfc_walk_intrinsic_function (gfc_ss *, gfc_expr *, gfc_ss *gfc_walk_intrinsic_function (gfc_ss *, gfc_expr *,
gfc_intrinsic_sym *); gfc_intrinsic_sym *);
......
...@@ -372,7 +372,8 @@ gfc_trans_call (gfc_code * code, bool dependency_check, ...@@ -372,7 +372,8 @@ gfc_trans_call (gfc_code * code, bool dependency_check,
ss = gfc_ss_terminator; ss = gfc_ss_terminator;
if (code->resolved_sym->attr.elemental) if (code->resolved_sym->attr.elemental)
ss = gfc_walk_elemental_function_args (ss, code->ext.actual, ss = gfc_walk_elemental_function_args (ss, code->ext.actual,
code->expr1, GFC_SS_REFERENCE); gfc_get_proc_ifc_for_expr (code->expr1),
GFC_SS_REFERENCE);
/* Is not an elemental subroutine call with array valued arguments. */ /* Is not an elemental subroutine call with array valued arguments. */
if (ss == gfc_ss_terminator) if (ss == gfc_ss_terminator)
......
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