* gfortran.h (operator): Remove macro.
(gfc_namespace, gfc_expr): Avoid C++ keywords.
* arith.c (eval_intrinsic, eval_intrinsic_f2, eval_intrinsic_f3):
Likewise.
* decl.c (access_attr_decl): Likewise.
* dependency.c (gfc_dep_compare_expr): Likewise.
* dump-parse-tree.c (show_expr, show_uop, show_namespace):
Likewise.
* expr.c (gfc_copy_expr, gfc_type_convert_binary,
simplify_intrinsic_op, check_intrinsic_op): Likewise.
* interface.c (fold_unary, gfc_match_generic_spec,
gfc_match_interface, gfc_match_end_interface,
check_operator_interface, check_uop_interfaces,
gfc_check_interfaces, gfc_extend_expr, gfc_extend_assign,
gfc_add_interface, gfc_current_interface_head,
gfc_set_current_interface_head): Likewise.
* iresolve.c (gfc_resolve_dot_product, gfc_resolve_matmul):
Likewise.
* matchexp.c (gfc_get_parentheses, build_node): Likewise.
* module.c (gfc_use_rename, gfc_match_use, find_use_name_n,
number_use_names, mio_expr, load_operator_interfaces, read_module,
write_operator, write_module): Likewise.
* openmp.c (resolve_omp_atomic): Likewise.
* resolve.c (resolve_operator, gfc_resolve_character_operator,
gfc_resolve_uops): Likewise.
* symbol.c (free_uop_tree, gfc_free_namespace): Likewise.
* trans-expr.c (gfc_conv_expr_op): Likewise.
* trans-openmp.c (gfc_trans_omp_atomic): Likewise.
From-SVN: r137981
+2008-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gfortran.h (operator): Remove macro.
+ (gfc_namespace, gfc_expr): Avoid C++ keywords.
+ * arith.c (eval_intrinsic, eval_intrinsic_f2, eval_intrinsic_f3):
+ Likewise.
+ * decl.c (access_attr_decl): Likewise.
+ * dependency.c (gfc_dep_compare_expr): Likewise.
+ * dump-parse-tree.c (show_expr, show_uop, show_namespace):
+ Likewise.
+ * expr.c (gfc_copy_expr, gfc_type_convert_binary,
+ simplify_intrinsic_op, check_intrinsic_op): Likewise.
+ * interface.c (fold_unary, gfc_match_generic_spec,
+ gfc_match_interface, gfc_match_end_interface,
+ check_operator_interface, check_uop_interfaces,
+ gfc_check_interfaces, gfc_extend_expr, gfc_extend_assign,
+ gfc_add_interface, gfc_current_interface_head,
+ gfc_set_current_interface_head): Likewise.
+ * iresolve.c (gfc_resolve_dot_product, gfc_resolve_matmul):
+ Likewise.
+ * matchexp.c (gfc_get_parentheses, build_node): Likewise.
+ * module.c (gfc_use_rename, gfc_match_use, find_use_name_n,
+ number_use_names, mio_expr, load_operator_interfaces, read_module,
+ write_operator, write_module): Likewise.
+ * openmp.c (resolve_omp_atomic): Likewise.
+ * resolve.c (resolve_operator, gfc_resolve_character_operator,
+ gfc_resolve_uops): Likewise.
+ * symbol.c (free_uop_tree, gfc_free_namespace): Likewise.
+ * trans-expr.c (gfc_conv_expr_op): Likewise.
+ * trans-openmp.c (gfc_trans_omp_atomic): Likewise.
+
2008-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gfortran.h (protected): Remove macro.
operands are array constructors. */
static gfc_expr *
-eval_intrinsic (gfc_intrinsic_op operator,
+eval_intrinsic (gfc_intrinsic_op op,
eval_f eval, gfc_expr *op1, gfc_expr *op2)
{
gfc_expr temp, *result;
gfc_clear_ts (&temp.ts);
- switch (operator)
+ switch (op)
{
/* Logical unary */
case INTRINSIC_NOT:
temp.expr_type = EXPR_OP;
gfc_clear_ts (&temp.ts);
- temp.value.op.operator = operator;
+ temp.value.op.op = op;
temp.value.op.op1 = op1;
temp.value.op.op2 = op2;
gfc_type_convert_binary (&temp);
- if (operator == INTRINSIC_EQ || operator == INTRINSIC_NE
- || operator == INTRINSIC_GE || operator == INTRINSIC_GT
- || operator == INTRINSIC_LE || operator == INTRINSIC_LT
- || operator == INTRINSIC_EQ_OS || operator == INTRINSIC_NE_OS
- || operator == INTRINSIC_GE_OS || operator == INTRINSIC_GT_OS
- || operator == INTRINSIC_LE_OS || operator == INTRINSIC_LT_OS)
+ if (op == INTRINSIC_EQ || op == INTRINSIC_NE
+ || op == INTRINSIC_GE || op == INTRINSIC_GT
+ || op == INTRINSIC_LE || op == INTRINSIC_LT
+ || op == INTRINSIC_EQ_OS || op == INTRINSIC_NE_OS
+ || op == INTRINSIC_GE_OS || op == INTRINSIC_GT_OS
+ || op == INTRINSIC_LE_OS || op == INTRINSIC_LT_OS)
{
temp.ts.type = BT_LOGICAL;
temp.ts.kind = gfc_default_logical_kind;
}
/* Try to combine the operators. */
- if (operator == INTRINSIC_POWER && op2->ts.type != BT_INTEGER)
+ if (op == INTRINSIC_POWER && op2->ts.type != BT_INTEGER)
goto runtime;
if (op1->expr_type != EXPR_CONSTANT
result->ts = temp.ts;
result->expr_type = EXPR_OP;
- result->value.op.operator = operator;
+ result->value.op.op = op;
result->value.op.op1 = op1;
result->value.op.op2 = op2;
static gfc_expr *
-eval_intrinsic_f2 (gfc_intrinsic_op operator,
+eval_intrinsic_f2 (gfc_intrinsic_op op,
arith (*eval) (gfc_expr *, gfc_expr **),
gfc_expr *op1, gfc_expr *op2)
{
if (op2 == NULL)
{
if (gfc_zero_size_array (op1))
- return eval_type_intrinsic0 (operator, op1);
+ return eval_type_intrinsic0 (op, op1);
}
else
{
result = reduce_binary0 (op1, op2);
if (result != NULL)
- return eval_type_intrinsic0 (operator, result);
+ return eval_type_intrinsic0 (op, result);
}
f.f2 = eval;
- return eval_intrinsic (operator, f, op1, op2);
+ return eval_intrinsic (op, f, op1, op2);
}
static gfc_expr *
-eval_intrinsic_f3 (gfc_intrinsic_op operator,
+eval_intrinsic_f3 (gfc_intrinsic_op op,
arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **),
gfc_expr *op1, gfc_expr *op2)
{
result = reduce_binary0 (op1, op2);
if (result != NULL)
- return eval_type_intrinsic0(operator, result);
+ return eval_type_intrinsic0(op, result);
f.f3 = eval;
- return eval_intrinsic (operator, f, op1, op2);
+ return eval_intrinsic (op, f, op1, op2);
}
interface_type type;
gfc_user_op *uop;
gfc_symbol *sym;
- gfc_intrinsic_op operator;
+ gfc_intrinsic_op op;
match m;
if (gfc_match (" ::") == MATCH_NO && gfc_match_space () == MATCH_NO)
for (;;)
{
- m = gfc_match_generic_spec (&type, name, &operator);
+ m = gfc_match_generic_spec (&type, name, &op);
if (m == MATCH_NO)
goto syntax;
if (m == MATCH_ERROR)
break;
case INTERFACE_INTRINSIC_OP:
- if (gfc_current_ns->operator_access[operator] == ACCESS_UNKNOWN)
+ if (gfc_current_ns->operator_access[op] == ACCESS_UNKNOWN)
{
- gfc_current_ns->operator_access[operator] =
+ gfc_current_ns->operator_access[op] =
(st == ST_PUBLIC) ? ACCESS_PUBLIC : ACCESS_PRIVATE;
}
else
{
gfc_error ("Access specification of the %s operator at %C has "
- "already been specified", gfc_op2string (operator));
+ "already been specified", gfc_op2string (op));
goto done;
}
int i;
if (e1->expr_type == EXPR_OP
- && (e1->value.op.operator == INTRINSIC_UPLUS
- || e1->value.op.operator == INTRINSIC_PARENTHESES))
+ && (e1->value.op.op == INTRINSIC_UPLUS
+ || e1->value.op.op == INTRINSIC_PARENTHESES))
return gfc_dep_compare_expr (e1->value.op.op1, e2);
if (e2->expr_type == EXPR_OP
- && (e2->value.op.operator == INTRINSIC_UPLUS
- || e2->value.op.operator == INTRINSIC_PARENTHESES))
+ && (e2->value.op.op == INTRINSIC_UPLUS
+ || e2->value.op.op == INTRINSIC_PARENTHESES))
return gfc_dep_compare_expr (e1, e2->value.op.op1);
- if (e1->expr_type == EXPR_OP && e1->value.op.operator == INTRINSIC_PLUS)
+ if (e1->expr_type == EXPR_OP && e1->value.op.op == INTRINSIC_PLUS)
{
/* Compare X+C vs. X. */
if (e1->value.op.op2->expr_type == EXPR_CONSTANT
return mpz_sgn (e1->value.op.op2->value.integer);
/* Compare P+Q vs. R+S. */
- if (e2->expr_type == EXPR_OP && e2->value.op.operator == INTRINSIC_PLUS)
+ if (e2->expr_type == EXPR_OP && e2->value.op.op == INTRINSIC_PLUS)
{
int l, r;
}
/* Compare X vs. X+C. */
- if (e2->expr_type == EXPR_OP && e2->value.op.operator == INTRINSIC_PLUS)
+ if (e2->expr_type == EXPR_OP && e2->value.op.op == INTRINSIC_PLUS)
{
if (e2->value.op.op2->expr_type == EXPR_CONSTANT
&& e2->value.op.op2->ts.type == BT_INTEGER
}
/* Compare X-C vs. X. */
- if (e1->expr_type == EXPR_OP && e1->value.op.operator == INTRINSIC_MINUS)
+ if (e1->expr_type == EXPR_OP && e1->value.op.op == INTRINSIC_MINUS)
{
if (e1->value.op.op2->expr_type == EXPR_CONSTANT
&& e1->value.op.op2->ts.type == BT_INTEGER
return -mpz_sgn (e1->value.op.op2->value.integer);
/* Compare P-Q vs. R-S. */
- if (e2->expr_type == EXPR_OP && e2->value.op.operator == INTRINSIC_MINUS)
+ if (e2->expr_type == EXPR_OP && e2->value.op.op == INTRINSIC_MINUS)
{
int l, r;
}
/* Compare X vs. X-C. */
- if (e2->expr_type == EXPR_OP && e2->value.op.operator == INTRINSIC_MINUS)
+ if (e2->expr_type == EXPR_OP && e2->value.op.op == INTRINSIC_MINUS)
{
if (e2->value.op.op2->expr_type == EXPR_CONSTANT
&& e2->value.op.op2->ts.type == BT_INTEGER
case EXPR_OP:
/* Intrinsic operators are the same if their operands are the same. */
- if (e1->value.op.operator != e2->value.op.operator)
+ if (e1->value.op.op != e2->value.op.op)
return -2;
if (e1->value.op.op2 == 0)
{
case EXPR_OP:
fputc ('(', dumpfile);
- switch (p->value.op.operator)
+ switch (p->value.op.op)
{
case INTRINSIC_UPLUS:
fputs ("U+ ", dumpfile);
show_indent ();
fprintf (dumpfile, "%s:", uop->name);
- for (intr = uop->operator; intr; intr = intr->next)
+ for (intr = uop->op; intr; intr = intr->next)
fprintf (dumpfile, " %s", intr->sym->name);
}
for (op = GFC_INTRINSIC_BEGIN; op != GFC_INTRINSIC_END; op++)
{
/* User operator interfaces */
- intr = ns->operator[op];
+ intr = ns->op[op];
if (intr == NULL)
continue;
break;
case EXPR_OP:
- switch (q->value.op.operator)
+ switch (q->value.op.op)
{
case INTRINSIC_NOT:
case INTRINSIC_PARENTHESES:
e->ts = op1->ts;
/* Special case for ** operator. */
- if (e->value.op.operator == INTRINSIC_POWER)
+ if (e->value.op.op == INTRINSIC_POWER)
goto done;
gfc_convert_type (e->value.op.op2, &e->ts, 2);
gfc_intrinsic_op op;
gfc_expr *op1, *op2, *result;
- if (p->value.op.operator == INTRINSIC_USER)
+ if (p->value.op.op == INTRINSIC_USER)
return SUCCESS;
op1 = p->value.op.op1;
op2 = p->value.op.op2;
- op = p->value.op.operator;
+ op = p->value.op.op;
if (gfc_simplify_expr (op1, type) == FAILURE)
return FAILURE;
if ((*check_function) (op1) == FAILURE)
return FAILURE;
- switch (e->value.op.operator)
+ switch (e->value.op.op)
{
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
if (!numeric_type (et0 (op1)) || !numeric_type (et0 (op2)))
goto not_numeric;
- if (e->value.op.operator == INTRINSIC_POWER
+ if (e->value.op.op == INTRINSIC_POWER
&& check_function == check_init_expr && et0 (op2) != BT_INTEGER)
{
if (gfc_notify_std (GFC_STD_F2003,"Fortran 2003: Noninteger "
#define gfc_get_interface() XCNEW (gfc_interface)
-/* FIXME: This macro is temporary until we convert everything. */
-#define operator op
/* User operator nodes. These are like stripped down symbols. */
typedef struct
{
/* Points to the equivalence groups produced by trans_common. */
struct gfc_equiv_list *equiv_lists;
- gfc_interface *operator[GFC_INTRINSIC_OPS];
+ gfc_interface *op[GFC_INTRINSIC_OPS];
/* Points to the parent namespace, i.e. the namespace of a module or
procedure in which the procedure belonging to this namespace is
struct
{
- gfc_intrinsic_op operator;
+ gfc_intrinsic_op op;
gfc_user_op *uop;
struct gfc_expr *op1, *op2;
}
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;
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;
}
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
break;
case INTERFACE_INTRINSIC_OP:
- current_interface.op = operator;
+ current_interface.op = op;
break;
case INTERFACE_NAMELESS:
{
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
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)
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;
/* 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);
/* 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)
{
}
/* 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 "
((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;
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;
if (r1 != r2 && r1 != 0 && r2 != 0)
return;
- switch (operator)
+ switch (op)
{
case INTRINSIC_EQ:
case INTRINSIC_EQ_OS:
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)
if (uop2 == NULL)
continue;
- check_interface1 (uop->operator, uop2->operator, 0,
+ check_interface1 (uop->op, uop2->op, 0,
interface_name, true);
}
}
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;
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)
{
if (uop == NULL)
continue;
- sym = gfc_search_interface (uop->operator, 0, &actual);
+ sym = gfc_search_interface (uop->op, 0, &actual);
if (sym != NULL)
break;
}
{
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)
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;
}
{
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:
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:
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:
break;
case INTERFACE_USER_OP:
- return current_interface.uop->operator;
+ return current_interface.uop->op;
break;
default:
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:
break;
case INTERFACE_USER_OP:
- current_interface.uop->operator = i;
+ current_interface.uop->op = i;
break;
default:
temp.expr_type = EXPR_OP;
gfc_clear_ts (&temp.ts);
- temp.value.op.operator = INTRINSIC_NONE;
+ temp.value.op.op = INTRINSIC_NONE;
temp.value.op.op1 = a;
temp.value.op.op2 = b;
gfc_type_convert_binary (&temp);
{
temp.expr_type = EXPR_OP;
gfc_clear_ts (&temp.ts);
- temp.value.op.operator = INTRINSIC_NONE;
+ temp.value.op.op = INTRINSIC_NONE;
temp.value.op.op1 = a;
temp.value.op.op2 = b;
gfc_type_convert_binary (&temp);
e2->ts = e->ts;
e2->rank = e->rank;
e2->where = e->where;
- e2->value.op.operator = INTRINSIC_PARENTHESES;
+ e2->value.op.op = INTRINSIC_PARENTHESES;
e2->value.op.op1 = e;
e2->value.op.op2 = NULL;
return e2;
/* Build an operator expression node. */
static gfc_expr *
-build_node (gfc_intrinsic_op operator, locus *where,
+build_node (gfc_intrinsic_op op, locus *where,
gfc_expr *op1, gfc_expr *op2)
{
gfc_expr *new;
new = gfc_get_expr ();
new->expr_type = EXPR_OP;
- new->value.op.operator = operator;
+ new->value.op.op = op;
new->where = *where;
new->value.op.op1 = op1;
char local_name[GFC_MAX_SYMBOL_LEN + 1], use_name[GFC_MAX_SYMBOL_LEN + 1];
struct gfc_use_rename *next;
int found;
- gfc_intrinsic_op operator;
+ gfc_intrinsic_op op;
locus where;
}
gfc_use_rename;
char name[GFC_MAX_SYMBOL_LEN + 1], module_nature[GFC_MAX_SYMBOL_LEN + 1];
gfc_use_rename *tail = NULL, *new;
interface_type type, type2;
- gfc_intrinsic_op operator;
+ gfc_intrinsic_op op;
match m;
specified_int = false;
/* See what kind of interface we're dealing with. Assume it is
not an operator. */
- new->operator = INTRINSIC_NONE;
- if (gfc_match_generic_spec (&type, name, &operator) == MATCH_ERROR)
+ new->op = INTRINSIC_NONE;
+ if (gfc_match_generic_spec (&type, name, &op) == MATCH_ERROR)
goto cleanup;
switch (type)
goto cleanup;
if (type == INTERFACE_USER_OP)
- new->operator = INTRINSIC_USER;
+ new->op = INTRINSIC_USER;
if (only_flag)
{
else
{
strcpy (new->local_name, name);
- m = gfc_match_generic_spec (&type2, new->use_name, &operator);
+ m = gfc_match_generic_spec (&type2, new->use_name, &op);
if (type != type2)
goto syntax;
if (m == MATCH_NO)
goto syntax;
strcpy (new->local_name, name);
- m = gfc_match_generic_spec (&type2, new->use_name, &operator);
+ m = gfc_match_generic_spec (&type2, new->use_name, &op);
if (type != type2)
goto syntax;
if (m == MATCH_NO)
break;
case INTERFACE_INTRINSIC_OP:
- new->operator = operator;
+ new->op = op;
break;
default:
for (u = gfc_rename_list; u; u = u->next)
{
if (strcmp (u->use_name, name) != 0
- || (u->operator == INTRINSIC_USER && !interface)
- || (u->operator != INTRINSIC_USER && interface))
+ || (u->op == INTRINSIC_USER && !interface)
+ || (u->op != INTRINSIC_USER && interface))
continue;
if (++i == *inst)
break;
/* Try to find the operator in the current list. */
static gfc_use_rename *
-find_use_operator (gfc_intrinsic_op operator)
+find_use_operator (gfc_intrinsic_op op)
{
gfc_use_rename *u;
for (u = gfc_rename_list; u; u = u->next)
- if (u->operator == operator)
+ if (u->op == op)
return u;
return NULL;
switch (e->expr_type)
{
case EXPR_OP:
- e->value.op.operator
- = MIO_NAME (gfc_intrinsic_op) (e->value.op.operator, intrinsics);
+ e->value.op.op
+ = MIO_NAME (gfc_intrinsic_op) (e->value.op.op, intrinsics);
- switch (e->value.op.operator)
+ switch (e->value.op.op)
{
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
if (i == 1)
{
uop = gfc_get_uop (p);
- pi = mio_interface_rest (&uop->operator);
+ pi = mio_interface_rest (&uop->op);
}
else
{
if (gfc_find_uop (p, NULL))
continue;
uop = gfc_get_uop (p);
- uop->operator = gfc_get_interface ();
- uop->operator->where = gfc_current_locus;
- add_fixup (pi->integer, &uop->operator->sym);
+ uop->op = gfc_get_interface ();
+ uop->op->where = gfc_current_locus;
+ add_fixup (pi->integer, &uop->op->sym);
}
}
}
u->found = 1;
}
- mio_interface (&gfc_current_ns->operator[i]);
+ mio_interface (&gfc_current_ns->op[i]);
}
mio_rparen ();
if (u->found)
continue;
- if (u->operator == INTRINSIC_NONE)
+ if (u->op == INTRINSIC_NONE)
{
gfc_error ("Symbol '%s' referenced at %L not found in module '%s'",
u->use_name, &u->where, module_name);
continue;
}
- if (u->operator == INTRINSIC_USER)
+ if (u->op == INTRINSIC_USER)
{
gfc_error ("User operator '%s' referenced at %L not found "
"in module '%s'", u->use_name, &u->where, module_name);
}
gfc_error ("Intrinsic operator '%s' referenced at %L not found "
- "in module '%s'", gfc_op2string (u->operator), &u->where,
+ "in module '%s'", gfc_op2string (u->op), &u->where,
module_name);
}
static char nullstring[] = "";
const char *p = nullstring;
- if (uop->operator == NULL
+ if (uop->op == NULL
|| !gfc_check_access (uop->access, uop->ns->default_access))
return;
- mio_symbol_interface (&uop->name, &p, &uop->operator);
+ mio_symbol_interface (&uop->name, &p, &uop->op);
}
mio_interface (gfc_check_access (gfc_current_ns->operator_access[i],
gfc_current_ns->default_access)
- ? &gfc_current_ns->operator[i] : NULL);
+ ? &gfc_current_ns->op[i] : NULL);
}
mio_rparen ();
if (expr2->expr_type == EXPR_OP)
{
gfc_expr *v = NULL, *e, *c;
- gfc_intrinsic_op op = expr2->value.op.operator;
+ gfc_intrinsic_op op = expr2->value.op.op;
gfc_intrinsic_op alt_op = INTRINSIC_NONE;
switch (op)
else if ((c = is_conversion (e, true)) != NULL)
q = &e->value.function.actual->expr;
else if (e->expr_type != EXPR_OP
- || (e->value.op.operator != op
- && e->value.op.operator != alt_op)
+ || (e->value.op.op != op
+ && e->value.op.op != alt_op)
|| e->rank != 0)
break;
else
if (p != NULL)
{
e = *p;
- switch (e->value.op.operator)
+ switch (e->value.op.op)
{
case INTRINSIC_MINUS:
case INTRINSIC_DIVIDE:
/* Resolve all subnodes-- give them types. */
- switch (e->value.op.operator)
+ switch (e->value.op.op)
{
default:
if (gfc_resolve_expr (e->value.op.op2) == FAILURE)
goto bad_op;
}
- switch (e->value.op.operator)
+ switch (e->value.op.op)
{
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
}
sprintf (msg, _("Operand of unary numeric operator '%s' at %%L is %s"),
- gfc_op2string (e->value.op.operator), gfc_typename (&e->ts));
+ gfc_op2string (e->value.op.op), gfc_typename (&e->ts));
goto bad_op;
case INTRINSIC_PLUS:
sprintf (msg,
_("Operands of binary numeric operator '%s' at %%L are %s/%s"),
- gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts),
+ gfc_op2string (e->value.op.op), gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
goto bad_op;
}
sprintf (msg, _("Operands of logical operator '%s' at %%L are %s/%s"),
- gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts),
+ gfc_op2string (e->value.op.op), gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
goto bad_op;
if (op1->ts.type == BT_LOGICAL && op2->ts.type == BT_LOGICAL)
sprintf (msg,
_("Logicals at %%L must be compared with %s instead of %s"),
- (e->value.op.operator == INTRINSIC_EQ
- || e->value.op.operator == INTRINSIC_EQ_OS)
- ? ".eqv." : ".neqv.", gfc_op2string (e->value.op.operator));
+ (e->value.op.op == INTRINSIC_EQ
+ || e->value.op.op == INTRINSIC_EQ_OS)
+ ? ".eqv." : ".neqv.", gfc_op2string (e->value.op.op));
else
sprintf (msg,
_("Operands of comparison operator '%s' at %%L are %s/%s"),
- gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts),
+ gfc_op2string (e->value.op.op), gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
goto bad_op;
case INTRINSIC_USER:
- if (e->value.op.uop->operator == NULL)
+ if (e->value.op.uop->op == NULL)
sprintf (msg, _("Unknown operator '%s' at %%L"), e->value.op.uop->name);
else if (op2 == NULL)
sprintf (msg, _("Operand of user operator '%s' at %%L is %s"),
t = SUCCESS;
- switch (e->value.op.operator)
+ switch (e->value.op.op)
{
case INTRINSIC_PLUS:
case INTRINSIC_MINUS:
gfc_expr *e1 = NULL;
gfc_expr *e2 = NULL;
- gcc_assert (e->value.op.operator == INTRINSIC_CONCAT);
+ gcc_assert (e->value.op.op == INTRINSIC_CONCAT);
if (op1->ts.cl && op1->ts.cl->length)
e1 = gfc_copy_expr (op1->ts.cl->length);
gfc_resolve_uops (symtree->left);
gfc_resolve_uops (symtree->right);
- for (itr = symtree->n.uop->operator; itr; itr = itr->next)
+ for (itr = symtree->n.uop->op; itr; itr = itr->next)
{
sym = itr->sym;
if (!sym->attr.function)
free_uop_tree (uop_tree->left);
free_uop_tree (uop_tree->right);
- gfc_free_interface (uop_tree->n.uop->operator);
+ gfc_free_interface (uop_tree->n.uop->op);
gfc_free (uop_tree->n.uop);
gfc_free (uop_tree);
gfc_free_equiv_lists (ns->equiv_lists);
for (i = GFC_INTRINSIC_BEGIN; i != GFC_INTRINSIC_END; i++)
- gfc_free_interface (ns->operator[i]);
+ gfc_free_interface (ns->op[i]);
gfc_free_data (ns->data);
p = ns->contained;
checkstring = 0;
lop = 0;
- switch (expr->value.op.operator)
+ switch (expr->value.op.op)
{
case INTRINSIC_PARENTHESES:
if (expr->ts.type == BT_REAL
if (expr2->expr_type == EXPR_OP)
{
gfc_expr *e;
- switch (expr2->value.op.operator)
+ switch (expr2->value.op.op)
{
case INTRINSIC_PLUS:
op = PLUS_EXPR;