diff options
author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-23 21:34:11 +0000 |
---|---|---|
committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-23 21:34:11 +0000 |
commit | 9b773341ece9ce02a693b7cd5a3787dfcd5aae6a (patch) | |
tree | 295ec2157631e2c5540017a7c342edfea10f1458 /gcc/fortran/resolve.c | |
parent | 2be7c5d9c9efdeda3f49999d50342f625edf9d53 (diff) | |
download | ppe42-gcc-9b773341ece9ce02a693b7cd5a3787dfcd5aae6a.tar.gz ppe42-gcc-9b773341ece9ce02a693b7cd5a3787dfcd5aae6a.zip |
* gfortran.h (gfc_expr): Move 'operator', 'op1', 'op2', and 'uop'
fields into new struct 'op' inside the 'value' union.
* arith.c (eval_intrinsic): Adapt all users.
* dependency.c (gfc_check_dependency): Likewise.
* dump-parse-tree.c (gfc_show_expr): Likewise.
* expr.c (gfc_get_expr): Don't clear removed fields.
(free_expr0, gfc_copy_expr, gfc_type_convert_binary,
gfc_is_constant_expr, simplify_intrinsic_op, check_init_expr,
check_intrinsic_op): Adapt to new field names.
* interface.c (gfc_extend_expr): Likewise. Also explicitly
nullify 'esym' and 'isym' fields of new function call.
* iresolve.c (gfc_resolve_dot_product, gfc_resolve_matmul):
Adapt to renamed structure fields.
* matchexp.c (build_node, match_level_1, match_expr): Likewise.
* module.c (mio_expr): Likewise.
* resolve.c (resolve_operator): Likewise.
(gfc_find_forall_index): Likewise. Only look through operands
if dealing with EXPR_OP
* trans-array.c (gfc_walk_op_expr): Adapt to renamed fields.
* trans-expr.c (gfc_conv_unary_op, gfc_conv_power_op,
gfc_conv_concat_op, gfc_conv_expr_op): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95471 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index dd69a983406..ecbd89ddfbc 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -1262,10 +1262,10 @@ resolve_operator (gfc_expr * e) /* Resolve all subnodes-- give them types. */ - switch (e->operator) + switch (e->value.op.operator) { default: - if (gfc_resolve_expr (e->op2) == FAILURE) + if (gfc_resolve_expr (e->value.op.op2) == FAILURE) return FAILURE; /* Fall through... */ @@ -1273,17 +1273,17 @@ resolve_operator (gfc_expr * e) case INTRINSIC_NOT: case INTRINSIC_UPLUS: case INTRINSIC_UMINUS: - if (gfc_resolve_expr (e->op1) == FAILURE) + if (gfc_resolve_expr (e->value.op.op1) == FAILURE) return FAILURE; break; } /* Typecheck the new node. */ - op1 = e->op1; - op2 = e->op2; + op1 = e->value.op.op1; + op2 = e->value.op.op2; - switch (e->operator) + switch (e->value.op.operator) { case INTRINSIC_UPLUS: case INTRINSIC_UMINUS: @@ -1296,7 +1296,7 @@ resolve_operator (gfc_expr * e) } sprintf (msg, "Operand of unary numeric operator '%s' at %%L is %s", - gfc_op2string (e->operator), gfc_typename (&e->ts)); + gfc_op2string (e->value.op.operator), gfc_typename (&e->ts)); goto bad_op; case INTRINSIC_PLUS: @@ -1312,7 +1312,7 @@ resolve_operator (gfc_expr * e) sprintf (msg, "Operands of binary numeric operator '%s' at %%L are %s/%s", - gfc_op2string (e->operator), gfc_typename (&op1->ts), + gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts), gfc_typename (&op2->ts)); goto bad_op; @@ -1345,7 +1345,7 @@ resolve_operator (gfc_expr * e) } sprintf (msg, "Operands of logical operator '%s' at %%L are %s/%s", - gfc_op2string (e->operator), gfc_typename (&op1->ts), + gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts), gfc_typename (&op2->ts)); goto bad_op; @@ -1393,7 +1393,7 @@ resolve_operator (gfc_expr * e) } sprintf (msg, "Operands of comparison operator '%s' at %%L are %s/%s", - gfc_op2string (e->operator), gfc_typename (&op1->ts), + gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts), gfc_typename (&op2->ts)); goto bad_op; @@ -1401,10 +1401,10 @@ resolve_operator (gfc_expr * e) case INTRINSIC_USER: if (op2 == NULL) sprintf (msg, "Operand of user operator '%s' at %%L is %s", - e->uop->name, gfc_typename (&op1->ts)); + e->value.op.uop->name, gfc_typename (&op1->ts)); else sprintf (msg, "Operands of user operator '%s' at %%L are %s/%s", - e->uop->name, gfc_typename (&op1->ts), + e->value.op.uop->name, gfc_typename (&op1->ts), gfc_typename (&op2->ts)); goto bad_op; @@ -1417,7 +1417,7 @@ resolve_operator (gfc_expr * e) t = SUCCESS; - switch (e->operator) + switch (e->value.op.operator) { case INTRINSIC_PLUS: case INTRINSIC_MINUS: @@ -3327,23 +3327,27 @@ gfc_find_forall_index (gfc_expr *expr, gfc_symbol *symbol) gfc_error ("Unsupported statement while finding forall index in " "expression"); break; - default: + + case EXPR_OP: + /* Find the FORALL index in the first operand. */ + if (expr->value.op.op1) + { + if (gfc_find_forall_index (expr->value.op.op1, symbol) == SUCCESS) + return SUCCESS; + } + + /* Find the FORALL index in the second operand. */ + if (expr->value.op.op2) + { + if (gfc_find_forall_index (expr->value.op.op2, symbol) == SUCCESS) + return SUCCESS; + } break; - } - /* Find the FORALL index in the first operand. */ - if (expr->op1) - { - if (gfc_find_forall_index (expr->op1, symbol) == SUCCESS) - return SUCCESS; + default: + break; } - /* Find the FORALL index in the second operand. */ - if (expr->op2) - { - if (gfc_find_forall_index (expr->op2, symbol) == SUCCESS) - return SUCCESS; - } return FAILURE; } |