diff options
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 147ded0..0fa5b57 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -95,32 +95,32 @@ gfc_free_interface (gfc_interface *intr) minus respectively, leaving the rest unchanged. */ static gfc_intrinsic_op -fold_unary (gfc_intrinsic_op operator) +fold_unary (gfc_intrinsic_op op) { - switch (operator) + switch (op) { case INTRINSIC_UPLUS: - operator = INTRINSIC_PLUS; + op = INTRINSIC_PLUS; break; case INTRINSIC_UMINUS: - operator = INTRINSIC_MINUS; + op = INTRINSIC_MINUS; break; default: break; } - return operator; + return op; } /* Match a generic specification. Depending on which type of - interface is found, the 'name' or 'operator' pointers may be set. + interface is found, the 'name' or 'op' pointers may be set. This subroutine doesn't return MATCH_NO. */ match gfc_match_generic_spec (interface_type *type, char *name, - gfc_intrinsic_op *operator) + gfc_intrinsic_op *op) { char buffer[GFC_MAX_SYMBOL_LEN + 1]; match m; @@ -129,14 +129,14 @@ gfc_match_generic_spec (interface_type *type, if (gfc_match (" assignment ( = )") == MATCH_YES) { *type = INTERFACE_INTRINSIC_OP; - *operator = INTRINSIC_ASSIGN; + *op = INTRINSIC_ASSIGN; return MATCH_YES; } if (gfc_match (" operator ( %o )", &i) == MATCH_YES) { /* Operator i/f */ *type = INTERFACE_INTRINSIC_OP; - *operator = fold_unary (i); + *op = fold_unary (i); return MATCH_YES; } @@ -184,12 +184,12 @@ gfc_match_interface (void) char name[GFC_MAX_SYMBOL_LEN + 1]; interface_type type; gfc_symbol *sym; - gfc_intrinsic_op operator; + gfc_intrinsic_op op; match m; m = gfc_match_space (); - if (gfc_match_generic_spec (&type, name, &operator) == MATCH_ERROR) + if (gfc_match_generic_spec (&type, name, &op) == MATCH_ERROR) return MATCH_ERROR; /* If we're not looking at the end of the statement now, or if this @@ -229,7 +229,7 @@ gfc_match_interface (void) break; case INTERFACE_INTRINSIC_OP: - current_interface.op = operator; + current_interface.op = op; break; case INTERFACE_NAMELESS: @@ -275,12 +275,12 @@ gfc_match_end_interface (void) { char name[GFC_MAX_SYMBOL_LEN + 1]; interface_type type; - gfc_intrinsic_op operator; + gfc_intrinsic_op op; match m; m = gfc_match_space (); - if (gfc_match_generic_spec (&type, name, &operator) == MATCH_ERROR) + if (gfc_match_generic_spec (&type, name, &op) == MATCH_ERROR) return MATCH_ERROR; /* If we're not looking at the end of the statement now, or if this @@ -308,7 +308,7 @@ gfc_match_end_interface (void) break; case INTERFACE_INTRINSIC_OP: - if (type != current_interface.type || operator != current_interface.op) + if (type != current_interface.type || op != current_interface.op) { if (current_interface.op == INTRINSIC_ASSIGN) @@ -538,7 +538,7 @@ find_keyword_arg (const char *name, gfc_formal_arglist *f) interfaces for that operator are legal. */ static void -check_operator_interface (gfc_interface *intr, gfc_intrinsic_op operator) +check_operator_interface (gfc_interface *intr, gfc_intrinsic_op op) { gfc_formal_arglist *formal; sym_intent i1, i2; @@ -585,10 +585,10 @@ check_operator_interface (gfc_interface *intr, gfc_intrinsic_op operator) /* Only +, - and .not. can be unary operators. .not. cannot be a binary operator. */ - if (args == 0 || args > 2 || (args == 1 && operator != INTRINSIC_PLUS - && operator != INTRINSIC_MINUS - && operator != INTRINSIC_NOT) - || (args == 2 && operator == INTRINSIC_NOT)) + if (args == 0 || args > 2 || (args == 1 && op != INTRINSIC_PLUS + && op != INTRINSIC_MINUS + && op != INTRINSIC_NOT) + || (args == 2 && op == INTRINSIC_NOT)) { gfc_error ("Operator interface at %L has the wrong number of arguments", &intr->sym->declared_at); @@ -597,7 +597,7 @@ check_operator_interface (gfc_interface *intr, gfc_intrinsic_op operator) /* Check that intrinsics are mapped to functions, except INTRINSIC_ASSIGN which should map to a subroutine. */ - if (operator == INTRINSIC_ASSIGN) + if (op == INTRINSIC_ASSIGN) { if (!sym->attr.subroutine) { @@ -638,7 +638,7 @@ check_operator_interface (gfc_interface *intr, gfc_intrinsic_op operator) } /* Check intents on operator interfaces. */ - if (operator == INTRINSIC_ASSIGN) + if (op == INTRINSIC_ASSIGN) { if (i1 != INTENT_OUT && i1 != INTENT_INOUT) gfc_error ("First argument of defined assignment at %L must be " @@ -674,7 +674,7 @@ check_operator_interface (gfc_interface *intr, gfc_intrinsic_op operator) ((t) == BT_INTEGER || (t) == BT_REAL || (t) == BT_COMPLEX) /* Unary ops are easy, do them first. */ - if (operator == INTRINSIC_NOT) + if (op == INTRINSIC_NOT) { if (t1 == BT_LOGICAL) goto bad_repl; @@ -682,7 +682,7 @@ check_operator_interface (gfc_interface *intr, gfc_intrinsic_op operator) return; } - if (args == 1 && (operator == INTRINSIC_PLUS || operator == INTRINSIC_MINUS)) + if (args == 1 && (op == INTRINSIC_PLUS || op == INTRINSIC_MINUS)) { if (IS_NUMERIC_TYPE (t1)) goto bad_repl; @@ -702,7 +702,7 @@ check_operator_interface (gfc_interface *intr, gfc_intrinsic_op operator) if (r1 != r2 && r1 != 0 && r2 != 0) return; - switch (operator) + switch (op) { case INTRINSIC_EQ: case INTRINSIC_EQ_OS: @@ -1243,7 +1243,7 @@ check_uop_interfaces (gfc_user_op *uop) gfc_namespace *ns; sprintf (interface_name, "operator interface '%s'", uop->name); - if (check_interface0 (uop->operator, interface_name)) + if (check_interface0 (uop->op, interface_name)) return; for (ns = gfc_current_ns; ns; ns = ns->parent) @@ -1252,7 +1252,7 @@ check_uop_interfaces (gfc_user_op *uop) if (uop2 == NULL) continue; - check_interface1 (uop->operator, uop2->operator, 0, + check_interface1 (uop->op, uop2->op, 0, interface_name, true); } } @@ -1288,76 +1288,76 @@ gfc_check_interfaces (gfc_namespace *ns) sprintf (interface_name, "intrinsic '%s' operator", gfc_op2string (i)); - if (check_interface0 (ns->operator[i], interface_name)) + if (check_interface0 (ns->op[i], interface_name)) continue; - check_operator_interface (ns->operator[i], i); + check_operator_interface (ns->op[i], i); for (ns2 = ns; ns2; ns2 = ns2->parent) { - if (check_interface1 (ns->operator[i], ns2->operator[i], 0, + if (check_interface1 (ns->op[i], ns2->op[i], 0, interface_name, true)) goto done; switch (i) { case INTRINSIC_EQ: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_EQ_OS], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_EQ_OS], 0, interface_name, true)) goto done; break; case INTRINSIC_EQ_OS: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_EQ], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_EQ], 0, interface_name, true)) goto done; break; case INTRINSIC_NE: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_NE_OS], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_NE_OS], 0, interface_name, true)) goto done; break; case INTRINSIC_NE_OS: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_NE], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_NE], 0, interface_name, true)) goto done; break; case INTRINSIC_GT: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_GT_OS], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_GT_OS], 0, interface_name, true)) goto done; break; case INTRINSIC_GT_OS: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_GT], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_GT], 0, interface_name, true)) goto done; break; case INTRINSIC_GE: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_GE_OS], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_GE_OS], 0, interface_name, true)) goto done; break; case INTRINSIC_GE_OS: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_GE], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_GE], 0, interface_name, true)) goto done; break; case INTRINSIC_LT: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_LT_OS], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_LT_OS], 0, interface_name, true)) goto done; break; case INTRINSIC_LT_OS: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_LT], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_LT], 0, interface_name, true)) goto done; break; case INTRINSIC_LE: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_LE_OS], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_LE_OS], 0, interface_name, true)) goto done; break; case INTRINSIC_LE_OS: - if (check_interface1 (ns->operator[i], ns2->operator[INTRINSIC_LE], + if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_LE], 0, interface_name, true)) goto done; break; @@ -2566,7 +2566,7 @@ gfc_extend_expr (gfc_expr *e) actual->next->expr = e->value.op.op2; } - i = fold_unary (e->value.op.operator); + i = fold_unary (e->value.op.op); if (i == INTRINSIC_USER) { @@ -2576,7 +2576,7 @@ gfc_extend_expr (gfc_expr *e) if (uop == NULL) continue; - sym = gfc_search_interface (uop->operator, 0, &actual); + sym = gfc_search_interface (uop->op, 0, &actual); if (sym != NULL) break; } @@ -2591,48 +2591,48 @@ gfc_extend_expr (gfc_expr *e) { case INTRINSIC_EQ: case INTRINSIC_EQ_OS: - sym = gfc_search_interface (ns->operator[INTRINSIC_EQ], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_EQ], 0, &actual); if (sym == NULL) - sym = gfc_search_interface (ns->operator[INTRINSIC_EQ_OS], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_EQ_OS], 0, &actual); break; case INTRINSIC_NE: case INTRINSIC_NE_OS: - sym = gfc_search_interface (ns->operator[INTRINSIC_NE], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_NE], 0, &actual); if (sym == NULL) - sym = gfc_search_interface (ns->operator[INTRINSIC_NE_OS], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_NE_OS], 0, &actual); break; case INTRINSIC_GT: case INTRINSIC_GT_OS: - sym = gfc_search_interface (ns->operator[INTRINSIC_GT], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_GT], 0, &actual); if (sym == NULL) - sym = gfc_search_interface (ns->operator[INTRINSIC_GT_OS], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_GT_OS], 0, &actual); break; case INTRINSIC_GE: case INTRINSIC_GE_OS: - sym = gfc_search_interface (ns->operator[INTRINSIC_GE], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_GE], 0, &actual); if (sym == NULL) - sym = gfc_search_interface (ns->operator[INTRINSIC_GE_OS], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_GE_OS], 0, &actual); break; case INTRINSIC_LT: case INTRINSIC_LT_OS: - sym = gfc_search_interface (ns->operator[INTRINSIC_LT], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_LT], 0, &actual); if (sym == NULL) - sym = gfc_search_interface (ns->operator[INTRINSIC_LT_OS], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_LT_OS], 0, &actual); break; case INTRINSIC_LE: case INTRINSIC_LE_OS: - sym = gfc_search_interface (ns->operator[INTRINSIC_LE], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_LE], 0, &actual); if (sym == NULL) - sym = gfc_search_interface (ns->operator[INTRINSIC_LE_OS], 0, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_LE_OS], 0, &actual); break; default: - sym = gfc_search_interface (ns->operator[i], 0, &actual); + sym = gfc_search_interface (ns->op[i], 0, &actual); } if (sym != NULL) @@ -2704,7 +2704,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns) for (; ns; ns = ns->parent) { - sym = gfc_search_interface (ns->operator[INTRINSIC_ASSIGN], 1, &actual); + sym = gfc_search_interface (ns->op[INTRINSIC_ASSIGN], 1, &actual); if (sym != NULL) break; } @@ -2771,52 +2771,52 @@ gfc_add_interface (gfc_symbol *new) { case INTRINSIC_EQ: case INTRINSIC_EQ_OS: - if (check_new_interface (ns->operator[INTRINSIC_EQ], new) == FAILURE || - check_new_interface (ns->operator[INTRINSIC_EQ_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_EQ], new) == FAILURE || + check_new_interface (ns->op[INTRINSIC_EQ_OS], new) == FAILURE) return FAILURE; break; case INTRINSIC_NE: case INTRINSIC_NE_OS: - if (check_new_interface (ns->operator[INTRINSIC_NE], new) == FAILURE || - check_new_interface (ns->operator[INTRINSIC_NE_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_NE], new) == FAILURE || + check_new_interface (ns->op[INTRINSIC_NE_OS], new) == FAILURE) return FAILURE; break; case INTRINSIC_GT: case INTRINSIC_GT_OS: - if (check_new_interface (ns->operator[INTRINSIC_GT], new) == FAILURE || - check_new_interface (ns->operator[INTRINSIC_GT_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_GT], new) == FAILURE || + check_new_interface (ns->op[INTRINSIC_GT_OS], new) == FAILURE) return FAILURE; break; case INTRINSIC_GE: case INTRINSIC_GE_OS: - if (check_new_interface (ns->operator[INTRINSIC_GE], new) == FAILURE || - check_new_interface (ns->operator[INTRINSIC_GE_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_GE], new) == FAILURE || + check_new_interface (ns->op[INTRINSIC_GE_OS], new) == FAILURE) return FAILURE; break; case INTRINSIC_LT: case INTRINSIC_LT_OS: - if (check_new_interface (ns->operator[INTRINSIC_LT], new) == FAILURE || - check_new_interface (ns->operator[INTRINSIC_LT_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_LT], new) == FAILURE || + check_new_interface (ns->op[INTRINSIC_LT_OS], new) == FAILURE) return FAILURE; break; case INTRINSIC_LE: case INTRINSIC_LE_OS: - if (check_new_interface (ns->operator[INTRINSIC_LE], new) == FAILURE || - check_new_interface (ns->operator[INTRINSIC_LE_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_LE], new) == FAILURE || + check_new_interface (ns->op[INTRINSIC_LE_OS], new) == FAILURE) return FAILURE; break; default: - if (check_new_interface (ns->operator[current_interface.op], new) == FAILURE) + if (check_new_interface (ns->op[current_interface.op], new) == FAILURE) return FAILURE; } - head = ¤t_interface.ns->operator[current_interface.op]; + head = ¤t_interface.ns->op[current_interface.op]; break; case INTERFACE_GENERIC: @@ -2834,11 +2834,11 @@ gfc_add_interface (gfc_symbol *new) break; case INTERFACE_USER_OP: - if (check_new_interface (current_interface.uop->operator, new) + if (check_new_interface (current_interface.uop->op, new) == FAILURE) return FAILURE; - head = ¤t_interface.uop->operator; + head = ¤t_interface.uop->op; break; default: @@ -2862,7 +2862,7 @@ gfc_current_interface_head (void) switch (current_interface.type) { case INTERFACE_INTRINSIC_OP: - return current_interface.ns->operator[current_interface.op]; + return current_interface.ns->op[current_interface.op]; break; case INTERFACE_GENERIC: @@ -2870,7 +2870,7 @@ gfc_current_interface_head (void) break; case INTERFACE_USER_OP: - return current_interface.uop->operator; + return current_interface.uop->op; break; default: @@ -2885,7 +2885,7 @@ gfc_set_current_interface_head (gfc_interface *i) switch (current_interface.type) { case INTERFACE_INTRINSIC_OP: - current_interface.ns->operator[current_interface.op] = i; + current_interface.ns->op[current_interface.op] = i; break; case INTERFACE_GENERIC: @@ -2893,7 +2893,7 @@ gfc_set_current_interface_head (gfc_interface *i) break; case INTERFACE_USER_OP: - current_interface.uop->operator = i; + current_interface.uop->op = i; break; default: |