Commit eaee02a5 by Janus Weil

gfortran.h (gfc_extend_expr): Modified prototype.

2011-11-06  Janus Weil  <janus@gcc.gnu.org>

	* gfortran.h (gfc_extend_expr): Modified prototype.
	* interface.c (gfc_extend_expr): Return 'match' instead of 'gfc_try'.
	Remove argument 'real_error'.
	* resolve.c (resolve_operator): Modified call to 'gfc_extend_expr'.

From-SVN: r181044
parent 9965f21f
2011-11-06 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (gfc_extend_expr): Modified prototype.
* interface.c (gfc_extend_expr): Return 'match' instead of 'gfc_try'.
Remove argument 'real_error'.
* resolve.c (resolve_operator): Modified call to 'gfc_extend_expr'.
2011-11-06 Andrew MacLeod <amacleod@redhat.com> 2011-11-06 Andrew MacLeod <amacleod@redhat.com>
Aldy Hernandez <aldyh@redhat.com> Aldy Hernandez <aldyh@redhat.com>
......
...@@ -2831,7 +2831,7 @@ void gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *); ...@@ -2831,7 +2831,7 @@ void gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *);
void gfc_ppc_use (gfc_component *, gfc_actual_arglist **, locus *); void gfc_ppc_use (gfc_component *, gfc_actual_arglist **, locus *);
gfc_symbol *gfc_search_interface (gfc_interface *, int, gfc_symbol *gfc_search_interface (gfc_interface *, int,
gfc_actual_arglist **); gfc_actual_arglist **);
gfc_try gfc_extend_expr (gfc_expr *, bool *); match gfc_extend_expr (gfc_expr *);
void gfc_free_formal_arglist (gfc_formal_arglist *); void gfc_free_formal_arglist (gfc_formal_arglist *);
gfc_try gfc_extend_assign (gfc_code *, gfc_namespace *); gfc_try gfc_extend_assign (gfc_code *, gfc_namespace *);
gfc_try gfc_add_interface (gfc_symbol *); gfc_try gfc_add_interface (gfc_symbol *);
......
...@@ -3221,12 +3221,11 @@ build_compcall_for_operator (gfc_expr* e, gfc_actual_arglist* actual, ...@@ -3221,12 +3221,11 @@ build_compcall_for_operator (gfc_expr* e, gfc_actual_arglist* actual,
with the operator. This subroutine builds an actual argument list with the operator. This subroutine builds an actual argument list
corresponding to the operands, then searches for a compatible corresponding to the operands, then searches for a compatible
interface. If one is found, the expression node is replaced with interface. If one is found, the expression node is replaced with
the appropriate function call. the appropriate function call. We use the 'match' enum to specify
real_error is an additional output argument that specifies if FAILURE whether a replacement has been made or not, or if an error occurred. */
is because of some real error and not because no match was found. */
gfc_try match
gfc_extend_expr (gfc_expr *e, bool *real_error) gfc_extend_expr (gfc_expr *e)
{ {
gfc_actual_arglist *actual; gfc_actual_arglist *actual;
gfc_symbol *sym; gfc_symbol *sym;
...@@ -3240,7 +3239,6 @@ gfc_extend_expr (gfc_expr *e, bool *real_error) ...@@ -3240,7 +3239,6 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
actual = gfc_get_actual_arglist (); actual = gfc_get_actual_arglist ();
actual->expr = e->value.op.op1; actual->expr = e->value.op.op1;
*real_error = false;
gname = NULL; gname = NULL;
if (e->value.op.op2 != NULL) if (e->value.op.op2 != NULL)
...@@ -3344,16 +3342,16 @@ gfc_extend_expr (gfc_expr *e, bool *real_error) ...@@ -3344,16 +3342,16 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
result = gfc_resolve_expr (e); result = gfc_resolve_expr (e);
if (result == FAILURE) if (result == FAILURE)
*real_error = true; return MATCH_ERROR;
return result; return MATCH_YES;
} }
/* Don't use gfc_free_actual_arglist(). */ /* Don't use gfc_free_actual_arglist(). */
free (actual->next); free (actual->next);
free (actual); free (actual);
return FAILURE; return MATCH_NO;
} }
/* Change the expression node to a function call. */ /* Change the expression node to a function call. */
...@@ -3366,12 +3364,9 @@ gfc_extend_expr (gfc_expr *e, bool *real_error) ...@@ -3366,12 +3364,9 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
e->user_operator = 1; e->user_operator = 1;
if (gfc_resolve_expr (e) == FAILURE) if (gfc_resolve_expr (e) == FAILURE)
{ return MATCH_ERROR;
*real_error = true;
return FAILURE;
}
return SUCCESS; return MATCH_YES;
} }
......
...@@ -4034,11 +4034,10 @@ resolve_operator (gfc_expr *e) ...@@ -4034,11 +4034,10 @@ resolve_operator (gfc_expr *e)
bad_op: bad_op:
{ {
bool real_error; match m = gfc_extend_expr (e);
if (gfc_extend_expr (e, &real_error) == SUCCESS) if (m == MATCH_YES)
return SUCCESS; return SUCCESS;
if (m == MATCH_ERROR)
if (real_error)
return FAILURE; return FAILURE;
} }
......
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