From 7b901ac47fb235195a14d401567b0b2677ad8a03 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Sat, 19 Jul 2008 16:23:52 +0000 Subject: [PATCH] gfortran.h (new): Remove macro. * gfortran.h (new): Remove macro. * array.c (gfc_append_constructor, match_array_list, gfc_match_array_constructor): Likewise. * bbt.c (insert, gfc_insert_bbt): Likewise. * decl.c (var_element, top_var_list, top_val_list, gfc_match_data, get_proc_name): Likewise. * expr.c (gfc_copy_actual_arglist): Likewise. * interface.c (compare_actual_formal, check_new_interface, gfc_add_interface): Likewise. * intrinsic.c gfc_convert_type_warn, gfc_convert_chartype): Likewise. * io.c (match_io_iterator, match_io_list): Likewise. * match.c (match_forall_header): Likewise. * matchexp.c (build_node): Likewise. * module.c (gfc_match_use): Likewise. * scanner.c (load_file): Likewise. * st.c (gfc_append_code): Likewise. * symbol.c (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols, gfc_commit_symbols): Likewise. * trans-common.c (build_field): Likewise. * trans-decl.c (gfc_finish_var_decl): Likewise. * trans-expr.c (gfc_free_interface_mapping, gfc_get_interface_mapping_charlen, gfc_add_interface_mapping, gfc_finish_interface_mapping, gfc_apply_interface_mapping_to_expr): Likewise. * trans.h (gfc_interface_sym_mapping): Likewise. From-SVN: r137982 --- gcc/fortran/ChangeLog | 29 ++++++++++++++++ gcc/fortran/array.c | 24 ++++++------- gcc/fortran/bbt.c | 14 ++++---- gcc/fortran/decl.c | 54 ++++++++++++++--------------- gcc/fortran/expr.c | 16 ++++----- gcc/fortran/gfortran.h | 2 -- gcc/fortran/interface.c | 72 +++++++++++++++++++------------------- gcc/fortran/intrinsic.c | 86 +++++++++++++++++++++++----------------------- gcc/fortran/io.c | 28 +++++++-------- gcc/fortran/match.c | 12 +++---- gcc/fortran/matchexp.c | 16 ++++----- gcc/fortran/module.c | 34 +++++++++--------- gcc/fortran/scanner.c | 6 ++-- gcc/fortran/st.c | 10 +++--- gcc/fortran/symbol.c | 10 +++--- gcc/fortran/trans-common.c | 6 ++-- gcc/fortran/trans-decl.c | 6 ++-- gcc/fortran/trans-expr.c | 34 +++++++++--------- gcc/fortran/trans.h | 2 +- 19 files changed, 244 insertions(+), 217 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1435ea3..87279c4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,34 @@ 2008-07-19 Kaveh R. Ghazi + * gfortran.h (new): Remove macro. + * array.c (gfc_append_constructor, match_array_list, + gfc_match_array_constructor): Likewise. + * bbt.c (insert, gfc_insert_bbt): Likewise. + * decl.c (var_element, top_var_list, top_val_list, gfc_match_data, + get_proc_name): Likewise. + * expr.c (gfc_copy_actual_arglist): Likewise. + * interface.c (compare_actual_formal, check_new_interface, + gfc_add_interface): Likewise. + * intrinsic.c gfc_convert_type_warn, gfc_convert_chartype): + Likewise. + * io.c (match_io_iterator, match_io_list): Likewise. + * match.c (match_forall_header): Likewise. + * matchexp.c (build_node): Likewise. + * module.c (gfc_match_use): Likewise. + * scanner.c (load_file): Likewise. + * st.c (gfc_append_code): Likewise. + * symbol.c (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols, + gfc_commit_symbols): Likewise. + * trans-common.c (build_field): Likewise. + * trans-decl.c (gfc_finish_var_decl): Likewise. + * trans-expr.c (gfc_free_interface_mapping, + gfc_get_interface_mapping_charlen, gfc_add_interface_mapping, + gfc_finish_interface_mapping, + gfc_apply_interface_mapping_to_expr): Likewise. + * trans.h (gfc_interface_sym_mapping): Likewise. + +2008-07-19 Kaveh R. Ghazi + * gfortran.h (operator): Remove macro. (gfc_namespace, gfc_expr): Avoid C++ keywords. * arith.c (eval_intrinsic, eval_intrinsic_f2, eval_intrinsic_f3): diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 1f41701..ab9e428 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -592,7 +592,7 @@ gfc_start_constructor (bt type, int kind, locus *where) node onto the constructor. */ void -gfc_append_constructor (gfc_expr *base, gfc_expr *new) +gfc_append_constructor (gfc_expr *base, gfc_expr *new_expr) { gfc_constructor *c; @@ -608,9 +608,9 @@ gfc_append_constructor (gfc_expr *base, gfc_expr *new) c = c->next; } - c->expr = new; + c->expr = new_expr; - if (new->ts.type != base->ts.type || new->ts.kind != base->ts.kind) + if (new_expr->ts.type != base->ts.type || new_expr->ts.kind != base->ts.kind) gfc_internal_error ("gfc_append_constructor(): New node has wrong kind"); } @@ -755,7 +755,7 @@ static match match_array_cons_element (gfc_constructor **); static match match_array_list (gfc_constructor **result) { - gfc_constructor *p, *head, *tail, *new; + gfc_constructor *p, *head, *tail, *new_cons; gfc_iterator iter; locus old_loc; gfc_expr *e; @@ -790,7 +790,7 @@ match_array_list (gfc_constructor **result) if (m == MATCH_ERROR) goto cleanup; - m = match_array_cons_element (&new); + m = match_array_cons_element (&new_cons); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_NO) @@ -801,8 +801,8 @@ match_array_list (gfc_constructor **result) goto cleanup; /* Could be a complex constant */ } - tail->next = new; - tail = new; + tail->next = new_cons; + tail = new_cons; if (gfc_match_char (',') != MATCH_YES) { @@ -881,7 +881,7 @@ match_array_cons_element (gfc_constructor **result) match gfc_match_array_constructor (gfc_expr **result) { - gfc_constructor *head, *tail, *new; + gfc_constructor *head, *tail, *new_cons; gfc_expr *expr; gfc_typespec ts; locus where; @@ -937,18 +937,18 @@ gfc_match_array_constructor (gfc_expr **result) for (;;) { - m = match_array_cons_element (&new); + m = match_array_cons_element (&new_cons); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_NO) goto syntax; if (head == NULL) - head = new; + head = new_cons; else - tail->next = new; + tail->next = new_cons; - tail = new; + tail = new_cons; if (gfc_match_char (',') == MATCH_NO) break; diff --git a/gcc/fortran/bbt.c b/gcc/fortran/bbt.c index e89eb57..fa60e4f 100644 --- a/gcc/fortran/bbt.c +++ b/gcc/fortran/bbt.c @@ -93,24 +93,24 @@ rotate_right (gfc_bbt *t) aborts if we find a duplicate key. */ static gfc_bbt * -insert (gfc_bbt *new, gfc_bbt *t, compare_fn compare) +insert (gfc_bbt *new_bbt, gfc_bbt *t, compare_fn compare) { int c; if (t == NULL) - return new; + return new_bbt; - c = (*compare) (new, t); + c = (*compare) (new_bbt, t); if (c < 0) { - t->left = insert (new, t->left, compare); + t->left = insert (new_bbt, t->left, compare); if (t->priority < t->left->priority) t = rotate_right (t); } else if (c > 0) { - t->right = insert (new, t->right, compare); + t->right = insert (new_bbt, t->right, compare); if (t->priority < t->right->priority) t = rotate_left (t); } @@ -126,12 +126,12 @@ insert (gfc_bbt *new, gfc_bbt *t, compare_fn compare) already exists. */ void -gfc_insert_bbt (void *root, void *new, compare_fn compare) +gfc_insert_bbt (void *root, void *new_node, compare_fn compare) { gfc_bbt **r, *n; r = (gfc_bbt **) root; - n = (gfc_bbt *) new; + n = (gfc_bbt *) new_node; n->priority = pseudo_random (); *r = insert (n, *r, compare); } diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 9fd54c5..b7b98d5 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -231,21 +231,21 @@ syntax: variable-iterator list. */ static match -var_element (gfc_data_variable *new) +var_element (gfc_data_variable *new_var) { match m; gfc_symbol *sym; - memset (new, 0, sizeof (gfc_data_variable)); + memset (new_var, 0, sizeof (gfc_data_variable)); if (gfc_match_char ('(') == MATCH_YES) - return var_list (new); + return var_list (new_var); - m = gfc_match_variable (&new->expr, 0); + m = gfc_match_variable (&new_var->expr, 0); if (m != MATCH_YES) return m; - sym = new->expr->symtree->n.sym; + sym = new_var->expr->symtree->n.sym; if (!sym->attr.function && gfc_current_ns->parent && gfc_current_ns->parent == sym->ns) @@ -262,7 +262,7 @@ var_element (gfc_data_variable *new) sym->name) == FAILURE) return MATCH_ERROR; - if (gfc_add_data (&sym->attr, sym->name, &new->expr->where) == FAILURE) + if (gfc_add_data (&sym->attr, sym->name, &new_var->expr->where) == FAILURE) return MATCH_ERROR; return MATCH_YES; @@ -274,7 +274,7 @@ var_element (gfc_data_variable *new) static match top_var_list (gfc_data *d) { - gfc_data_variable var, *tail, *new; + gfc_data_variable var, *tail, *new_var; match m; tail = NULL; @@ -287,15 +287,15 @@ top_var_list (gfc_data *d) if (m == MATCH_ERROR) return MATCH_ERROR; - new = gfc_get_data_variable (); - *new = var; + new_var = gfc_get_data_variable (); + *new_var = var; if (tail == NULL) - d->var = new; + d->var = new_var; else - tail->next = new; + tail->next = new_var; - tail = new; + tail = new_var; if (gfc_match_char ('/') == MATCH_YES) break; @@ -404,7 +404,7 @@ match_data_constant (gfc_expr **result) static match top_val_list (gfc_data *data) { - gfc_data_value *new, *tail; + gfc_data_value *new_val, *tail; gfc_expr *expr; match m; @@ -418,15 +418,15 @@ top_val_list (gfc_data *data) if (m == MATCH_ERROR) return MATCH_ERROR; - new = gfc_get_data_value (); - mpz_init (new->repeat); + new_val = gfc_get_data_value (); + mpz_init (new_val->repeat); if (tail == NULL) - data->value = new; + data->value = new_val; else - tail->next = new; + tail->next = new_val; - tail = new; + tail = new_val; if (expr->ts.type != BT_INTEGER || gfc_match_char ('*') != MATCH_YES) { @@ -518,26 +518,26 @@ match_old_style_init (const char *name) match gfc_match_data (void) { - gfc_data *new; + gfc_data *new_data; match m; set_in_match_data (true); for (;;) { - new = gfc_get_data (); - new->where = gfc_current_locus; + new_data = gfc_get_data (); + new_data->where = gfc_current_locus; - m = top_var_list (new); + m = top_var_list (new_data); if (m != MATCH_YES) goto cleanup; - m = top_val_list (new); + m = top_val_list (new_data); if (m != MATCH_YES) goto cleanup; - new->next = gfc_current_ns->data; - gfc_current_ns->data = new; + new_data->next = gfc_current_ns->data; + gfc_current_ns->data = new_data; if (gfc_match_eos () == MATCH_YES) break; @@ -557,7 +557,7 @@ gfc_match_data (void) cleanup: set_in_match_data (false); - gfc_free_data (new); + gfc_free_data (new_data); return MATCH_ERROR; } @@ -781,7 +781,7 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry) sym = *result; gfc_current_ns->refs++; - if (sym && !sym->new && gfc_current_state () != COMP_INTERFACE) + if (sym && !sym->gfc_new && gfc_current_state () != COMP_INTERFACE) { /* Trap another encompassed procedure with the same name. All these conditions are necessary to avoid picking up an entry diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index c0c4fdd..aabcb4f 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -65,24 +65,24 @@ gfc_free_actual_arglist (gfc_actual_arglist *a1) gfc_actual_arglist * gfc_copy_actual_arglist (gfc_actual_arglist *p) { - gfc_actual_arglist *head, *tail, *new; + gfc_actual_arglist *head, *tail, *new_arg; head = tail = NULL; for (; p; p = p->next) { - new = gfc_get_actual_arglist (); - *new = *p; + new_arg = gfc_get_actual_arglist (); + *new_arg = *p; - new->expr = gfc_copy_expr (p->expr); - new->next = NULL; + new_arg->expr = gfc_copy_expr (p->expr); + new_arg->next = NULL; if (head == NULL) - head = new; + head = new_arg; else - tail->next = new; + tail->next = new_arg; - tail = new; + tail = new_arg; } return head; diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index e8a4cf2..5a3b4c8 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1053,8 +1053,6 @@ typedef struct gfc_symbol the old symbol. */ struct gfc_symbol *old_symbol, *tlink; - /* FIXME: This macro is temporary until we convert everything. */ -#define new gfc_new unsigned mark:1, gfc_new:1; /* Nonzero if all equivalences associated with this symbol have been processed. */ diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 0fa5b57..d4809f0 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1823,7 +1823,7 @@ static int compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, int ranks_must_agree, int is_elemental, locus *where) { - gfc_actual_arglist **new, *a, *actual, temp; + gfc_actual_arglist **new_arg, *a, *actual, temp; gfc_formal_arglist *f; int i, n, na; unsigned long actual_size, formal_size; @@ -1837,10 +1837,10 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, for (f = formal; f; f = f->next) n++; - new = (gfc_actual_arglist **) alloca (n * sizeof (gfc_actual_arglist *)); + new_arg = (gfc_actual_arglist **) alloca (n * sizeof (gfc_actual_arglist *)); for (i = 0; i < n; i++) - new[i] = NULL; + new_arg[i] = NULL; na = 0; f = formal; @@ -1868,7 +1868,7 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, return 0; } - if (new[i] != NULL) + if (new_arg[i] != NULL) { if (where) gfc_error ("Keyword argument '%s' at %L is already associated " @@ -2113,14 +2113,14 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, if (a == actual) na = i; - new[i++] = a; + new_arg[i++] = a; } /* Make sure missing actual arguments are optional. */ i = 0; for (f = formal; f; f = f->next, i++) { - if (new[i] != NULL) + if (new_arg[i] != NULL) continue; if (f->sym == NULL) { @@ -2142,27 +2142,27 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, argument list with null arguments in the right places. The head of the list remains the head. */ for (i = 0; i < n; i++) - if (new[i] == NULL) - new[i] = gfc_get_actual_arglist (); + if (new_arg[i] == NULL) + new_arg[i] = gfc_get_actual_arglist (); if (na != 0) { - temp = *new[0]; - *new[0] = *actual; + temp = *new_arg[0]; + *new_arg[0] = *actual; *actual = temp; - a = new[0]; - new[0] = new[na]; - new[na] = a; + a = new_arg[0]; + new_arg[0] = new_arg[na]; + new_arg[na] = a; } for (i = 0; i < n - 1; i++) - new[i]->next = new[i + 1]; + new_arg[i]->next = new_arg[i + 1]; - new[i]->next = NULL; + new_arg[i]->next = NULL; if (*ap == NULL && n > 0) - *ap = new[0]; + *ap = new_arg[0]; /* Note the types of omitted optional arguments. */ for (a = *ap, f = formal; a; a = a->next, f = f->next) @@ -2732,16 +2732,16 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns) procedures can be present without interfaces. */ static try -check_new_interface (gfc_interface *base, gfc_symbol *new) +check_new_interface (gfc_interface *base, gfc_symbol *new_sym) { gfc_interface *ip; for (ip = base; ip; ip = ip->next) { - if (ip->sym == new) + if (ip->sym == new_sym) { gfc_error ("Entity '%s' at %C is already present in the interface", - new->name); + new_sym->name); return FAILURE; } } @@ -2753,7 +2753,7 @@ check_new_interface (gfc_interface *base, gfc_symbol *new) /* Add a symbol to the current interface. */ try -gfc_add_interface (gfc_symbol *new) +gfc_add_interface (gfc_symbol *new_sym) { gfc_interface **head, *intr; gfc_namespace *ns; @@ -2771,48 +2771,48 @@ gfc_add_interface (gfc_symbol *new) { case INTRINSIC_EQ: case INTRINSIC_EQ_OS: - if (check_new_interface (ns->op[INTRINSIC_EQ], new) == FAILURE || - check_new_interface (ns->op[INTRINSIC_EQ_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_EQ], new_sym) == FAILURE || + check_new_interface (ns->op[INTRINSIC_EQ_OS], new_sym) == FAILURE) return FAILURE; break; case INTRINSIC_NE: case INTRINSIC_NE_OS: - if (check_new_interface (ns->op[INTRINSIC_NE], new) == FAILURE || - check_new_interface (ns->op[INTRINSIC_NE_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_NE], new_sym) == FAILURE || + check_new_interface (ns->op[INTRINSIC_NE_OS], new_sym) == FAILURE) return FAILURE; break; case INTRINSIC_GT: case INTRINSIC_GT_OS: - if (check_new_interface (ns->op[INTRINSIC_GT], new) == FAILURE || - check_new_interface (ns->op[INTRINSIC_GT_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_GT], new_sym) == FAILURE || + check_new_interface (ns->op[INTRINSIC_GT_OS], new_sym) == FAILURE) return FAILURE; break; case INTRINSIC_GE: case INTRINSIC_GE_OS: - if (check_new_interface (ns->op[INTRINSIC_GE], new) == FAILURE || - check_new_interface (ns->op[INTRINSIC_GE_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_GE], new_sym) == FAILURE || + check_new_interface (ns->op[INTRINSIC_GE_OS], new_sym) == FAILURE) return FAILURE; break; case INTRINSIC_LT: case INTRINSIC_LT_OS: - if (check_new_interface (ns->op[INTRINSIC_LT], new) == FAILURE || - check_new_interface (ns->op[INTRINSIC_LT_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_LT], new_sym) == FAILURE || + check_new_interface (ns->op[INTRINSIC_LT_OS], new_sym) == FAILURE) return FAILURE; break; case INTRINSIC_LE: case INTRINSIC_LE_OS: - if (check_new_interface (ns->op[INTRINSIC_LE], new) == FAILURE || - check_new_interface (ns->op[INTRINSIC_LE_OS], new) == FAILURE) + if (check_new_interface (ns->op[INTRINSIC_LE], new_sym) == FAILURE || + check_new_interface (ns->op[INTRINSIC_LE_OS], new_sym) == FAILURE) return FAILURE; break; default: - if (check_new_interface (ns->op[current_interface.op], new) == FAILURE) + if (check_new_interface (ns->op[current_interface.op], new_sym) == FAILURE) return FAILURE; } @@ -2826,7 +2826,7 @@ gfc_add_interface (gfc_symbol *new) if (sym == NULL) continue; - if (check_new_interface (sym->generic, new) == FAILURE) + if (check_new_interface (sym->generic, new_sym) == FAILURE) return FAILURE; } @@ -2834,7 +2834,7 @@ gfc_add_interface (gfc_symbol *new) break; case INTERFACE_USER_OP: - if (check_new_interface (current_interface.uop->op, new) + if (check_new_interface (current_interface.uop->op, new_sym) == FAILURE) return FAILURE; @@ -2846,7 +2846,7 @@ gfc_add_interface (gfc_symbol *new) } intr = gfc_get_interface (); - intr->sym = new; + intr->sym = new_sym; intr->where = gfc_current_locus; intr->next = *head; diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index db3237e..4c55a2c 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -3680,7 +3680,7 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag) gfc_intrinsic_sym *sym; gfc_typespec from_ts; locus old_where; - gfc_expr *new; + gfc_expr *new_expr; int rank; mpz_t *shape; @@ -3722,29 +3722,29 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag) rank = expr->rank; shape = expr->shape; - new = gfc_get_expr (); - *new = *expr; - - new = gfc_build_conversion (new); - new->value.function.name = sym->lib_name; - new->value.function.isym = sym; - new->where = old_where; - new->rank = rank; - new->shape = gfc_copy_shape (shape, rank); - - gfc_get_ha_sym_tree (sym->name, &new->symtree); - new->symtree->n.sym->ts = *ts; - new->symtree->n.sym->attr.flavor = FL_PROCEDURE; - new->symtree->n.sym->attr.function = 1; - new->symtree->n.sym->attr.elemental = 1; - new->symtree->n.sym->attr.pure = 1; - new->symtree->n.sym->attr.referenced = 1; - gfc_intrinsic_symbol(new->symtree->n.sym); - gfc_commit_symbol (new->symtree->n.sym); - - *expr = *new; - - gfc_free (new); + new_expr = gfc_get_expr (); + *new_expr = *expr; + + new_expr = gfc_build_conversion (new_expr); + new_expr->value.function.name = sym->lib_name; + new_expr->value.function.isym = sym; + new_expr->where = old_where; + new_expr->rank = rank; + new_expr->shape = gfc_copy_shape (shape, rank); + + gfc_get_ha_sym_tree (sym->name, &new_expr->symtree); + new_expr->symtree->n.sym->ts = *ts; + new_expr->symtree->n.sym->attr.flavor = FL_PROCEDURE; + new_expr->symtree->n.sym->attr.function = 1; + new_expr->symtree->n.sym->attr.elemental = 1; + new_expr->symtree->n.sym->attr.pure = 1; + new_expr->symtree->n.sym->attr.referenced = 1; + gfc_intrinsic_symbol(new_expr->symtree->n.sym); + gfc_commit_symbol (new_expr->symtree->n.sym); + + *expr = *new_expr; + + gfc_free (new_expr); expr->ts = *ts; if (gfc_is_constant_expr (expr->value.function.actual->expr) @@ -3779,7 +3779,7 @@ gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts) gfc_intrinsic_sym *sym; gfc_typespec from_ts; locus old_where; - gfc_expr *new; + gfc_expr *new_expr; int rank; mpz_t *shape; @@ -3794,28 +3794,28 @@ gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts) rank = expr->rank; shape = expr->shape; - new = gfc_get_expr (); - *new = *expr; + new_expr = gfc_get_expr (); + *new_expr = *expr; - new = gfc_build_conversion (new); - new->value.function.name = sym->lib_name; - new->value.function.isym = sym; - new->where = old_where; - new->rank = rank; - new->shape = gfc_copy_shape (shape, rank); + new_expr = gfc_build_conversion (new_expr); + new_expr->value.function.name = sym->lib_name; + new_expr->value.function.isym = sym; + new_expr->where = old_where; + new_expr->rank = rank; + new_expr->shape = gfc_copy_shape (shape, rank); - gfc_get_ha_sym_tree (sym->name, &new->symtree); - new->symtree->n.sym->ts = *ts; - new->symtree->n.sym->attr.flavor = FL_PROCEDURE; - new->symtree->n.sym->attr.function = 1; - new->symtree->n.sym->attr.elemental = 1; - new->symtree->n.sym->attr.referenced = 1; - gfc_intrinsic_symbol(new->symtree->n.sym); - gfc_commit_symbol (new->symtree->n.sym); + gfc_get_ha_sym_tree (sym->name, &new_expr->symtree); + new_expr->symtree->n.sym->ts = *ts; + new_expr->symtree->n.sym->attr.flavor = FL_PROCEDURE; + new_expr->symtree->n.sym->attr.function = 1; + new_expr->symtree->n.sym->attr.elemental = 1; + new_expr->symtree->n.sym->attr.referenced = 1; + gfc_intrinsic_symbol(new_expr->symtree->n.sym); + gfc_commit_symbol (new_expr->symtree->n.sym); - *expr = *new; + *expr = *new_expr; - gfc_free (new); + gfc_free (new_expr); expr->ts = *ts; if (gfc_is_constant_expr (expr->value.function.actual->expr) diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 23bf5f9..4af0971 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -2623,7 +2623,7 @@ static match match_io_element (io_kind, gfc_code **); static match match_io_iterator (io_kind k, gfc_code **result) { - gfc_code *head, *tail, *new; + gfc_code *head, *tail, *new_code; gfc_iterator *iter; locus old_loc; match m; @@ -2659,7 +2659,7 @@ match_io_iterator (io_kind k, gfc_code **result) break; } - m = match_io_element (k, &new); + m = match_io_element (k, &new_code); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_NO) @@ -2669,7 +2669,7 @@ match_io_iterator (io_kind k, gfc_code **result) goto cleanup; } - tail = gfc_append_code (tail, new); + tail = gfc_append_code (tail, new_code); if (gfc_match_char (',') != MATCH_YES) { @@ -2683,15 +2683,15 @@ match_io_iterator (io_kind k, gfc_code **result) if (gfc_match_char (')') != MATCH_YES) goto syntax; - new = gfc_get_code (); - new->op = EXEC_DO; - new->ext.iterator = iter; + new_code = gfc_get_code (); + new_code->op = EXEC_DO; + new_code->ext.iterator = iter; - new->block = gfc_get_code (); - new->block->op = EXEC_DO; - new->block->next = head; + new_code->block = gfc_get_code (); + new_code->block->op = EXEC_DO; + new_code->block->next = head; - *result = new; + *result = new_code; return MATCH_YES; syntax: @@ -2799,7 +2799,7 @@ match_io_element (io_kind k, gfc_code **cpp) static match match_io_list (io_kind k, gfc_code **head_p) { - gfc_code *head, *tail, *new; + gfc_code *head, *tail, *new_code; match m; *head_p = head = tail = NULL; @@ -2808,15 +2808,15 @@ match_io_list (io_kind k, gfc_code **head_p) for (;;) { - m = match_io_element (k, &new); + m = match_io_element (k, &new_code); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_NO) goto syntax; - tail = gfc_append_code (tail, new); + tail = gfc_append_code (tail, new_code); if (head == NULL) - head = new; + head = new_code; if (gfc_match_eos () == MATCH_YES) break; diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index feaa268..19a97e9 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -3836,7 +3836,7 @@ cleanup: static match match_forall_header (gfc_forall_iterator **phead, gfc_expr **mask) { - gfc_forall_iterator *head, *tail, *new; + gfc_forall_iterator *head, *tail, *new_iter; gfc_expr *msk; match m; @@ -3848,27 +3848,27 @@ match_forall_header (gfc_forall_iterator **phead, gfc_expr **mask) if (gfc_match_char ('(') != MATCH_YES) return MATCH_NO; - m = match_forall_iterator (&new); + m = match_forall_iterator (&new_iter); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_NO) goto syntax; - head = tail = new; + head = tail = new_iter; for (;;) { if (gfc_match_char (',') != MATCH_YES) break; - m = match_forall_iterator (&new); + m = match_forall_iterator (&new_iter); if (m == MATCH_ERROR) goto cleanup; if (m == MATCH_YES) { - tail->next = new; - tail = new; + tail->next = new_iter; + tail = new_iter; continue; } diff --git a/gcc/fortran/matchexp.c b/gcc/fortran/matchexp.c index 433f4d2..a53c69b 100644 --- a/gcc/fortran/matchexp.c +++ b/gcc/fortran/matchexp.c @@ -211,17 +211,17 @@ static gfc_expr * build_node (gfc_intrinsic_op op, locus *where, gfc_expr *op1, gfc_expr *op2) { - gfc_expr *new; + gfc_expr *new_expr; - new = gfc_get_expr (); - new->expr_type = EXPR_OP; - new->value.op.op = op; - new->where = *where; + new_expr = gfc_get_expr (); + new_expr->expr_type = EXPR_OP; + new_expr->value.op.op = op; + new_expr->where = *where; - new->value.op.op1 = op1; - new->value.op.op2 = op2; + new_expr->value.op.op1 = op1; + new_expr->value.op.op2 = op2; - return new; + return new_expr; } diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 3f27fda..365dd98 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -502,7 +502,7 @@ match gfc_match_use (void) { char name[GFC_MAX_SYMBOL_LEN + 1], module_nature[GFC_MAX_SYMBOL_LEN + 1]; - gfc_use_rename *tail = NULL, *new; + gfc_use_rename *tail = NULL, *new_use; interface_type type, type2; gfc_intrinsic_op op; match m; @@ -581,19 +581,19 @@ gfc_match_use (void) for (;;) { /* Get a new rename struct and add it to the rename list. */ - new = gfc_get_use_rename (); - new->where = gfc_current_locus; - new->found = 0; + new_use = gfc_get_use_rename (); + new_use->where = gfc_current_locus; + new_use->found = 0; if (gfc_rename_list == NULL) - gfc_rename_list = new; + gfc_rename_list = new_use; else - tail->next = new; - tail = new; + tail->next = new_use; + tail = new_use; /* See what kind of interface we're dealing with. Assume it is not an operator. */ - new->op = INTRINSIC_NONE; + new_use->op = INTRINSIC_NONE; if (gfc_match_generic_spec (&type, name, &op) == MATCH_ERROR) goto cleanup; @@ -614,16 +614,16 @@ gfc_match_use (void) goto cleanup; if (type == INTERFACE_USER_OP) - new->op = INTRINSIC_USER; + new_use->op = INTRINSIC_USER; if (only_flag) { if (m != MATCH_YES) - strcpy (new->use_name, name); + strcpy (new_use->use_name, name); else { - strcpy (new->local_name, name); - m = gfc_match_generic_spec (&type2, new->use_name, &op); + strcpy (new_use->local_name, name); + m = gfc_match_generic_spec (&type2, new_use->use_name, &op); if (type != type2) goto syntax; if (m == MATCH_NO) @@ -636,9 +636,9 @@ gfc_match_use (void) { if (m != MATCH_YES) goto syntax; - strcpy (new->local_name, name); + strcpy (new_use->local_name, name); - m = gfc_match_generic_spec (&type2, new->use_name, &op); + m = gfc_match_generic_spec (&type2, new_use->use_name, &op); if (type != type2) goto syntax; if (m == MATCH_NO) @@ -647,8 +647,8 @@ gfc_match_use (void) goto cleanup; } - if (strcmp (new->use_name, module_name) == 0 - || strcmp (new->local_name, module_name) == 0) + if (strcmp (new_use->use_name, module_name) == 0 + || strcmp (new_use->local_name, module_name) == 0) { gfc_error ("The name '%s' at %C has already been used as " "an external module name.", module_name); @@ -657,7 +657,7 @@ gfc_match_use (void) break; case INTERFACE_INTRINSIC_OP: - new->op = op; + new_use->op = op; break; default: diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 48f148d..6e6017a 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -1840,11 +1840,11 @@ load_file (const char *filename, bool initial) && line[2] == (unsigned char) '\xBF'))) { int n = line[1] == (unsigned char) '\xBB' ? 3 : 2; - gfc_char_t *new = gfc_get_wide_string (line_len); + gfc_char_t *new_char = gfc_get_wide_string (line_len); - wide_strcpy (new, &line[n]); + wide_strcpy (new_char, &line[n]); gfc_free (line); - line = new; + line = new_char; len -= n; } diff --git a/gcc/fortran/st.c b/gcc/fortran/st.c index ba5656b..790dec6 100644 --- a/gcc/fortran/st.c +++ b/gcc/fortran/st.c @@ -58,20 +58,20 @@ gfc_get_code (void) its tail, returning a pointer to the new tail. */ gfc_code * -gfc_append_code (gfc_code *tail, gfc_code *new) +gfc_append_code (gfc_code *tail, gfc_code *new_code) { if (tail != NULL) { while (tail->next != NULL) tail = tail->next; - tail->next = new; + tail->next = new_code; } - while (new->next != NULL) - new = new->next; + while (new_code->next != NULL) + new_code = new_code->next; - return new; + return new_code; } diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 57870c0..ca1237e 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2451,7 +2451,7 @@ static void save_symbol_data (gfc_symbol *sym) { - if (sym->new || sym->old_symbol != NULL) + if (sym->gfc_new || sym->old_symbol != NULL) return; sym->old_symbol = XCNEW (gfc_symbol); @@ -2495,7 +2495,7 @@ gfc_get_sym_tree (const char *name, gfc_namespace *ns, gfc_symtree **result) p->old_symbol = NULL; p->tlink = changed_syms; p->mark = 1; - p->new = 1; + p->gfc_new = 1; changed_syms = p; st = gfc_new_symtree (&ns->sym_root, name); @@ -2643,7 +2643,7 @@ gfc_undo_symbols (void) { q = p->tlink; - if (p->new) + if (p->gfc_new) { /* Symbol was new. */ if (p->attr.in_common && p->common_block->head) @@ -2779,7 +2779,7 @@ gfc_commit_symbols (void) q = p->tlink; p->tlink = NULL; p->mark = 0; - p->new = 0; + p->gfc_new = 0; free_old_symbol (p); } changed_syms = NULL; @@ -2808,7 +2808,7 @@ gfc_commit_symbol (gfc_symbol *sym) sym->tlink = NULL; sym->mark = 0; - sym->new = 0; + sym->gfc_new = 0; free_old_symbol (sym); } diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 5c91bf5..4b95f5f 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -321,10 +321,10 @@ build_field (segment_info *h, tree union_type, record_layout_info rli) /* If this field is volatile, mark it. */ if (h->sym->attr.volatile_) { - tree new; + tree new_type; TREE_THIS_VOLATILE (field) = 1; - new = build_qualified_type (TREE_TYPE (field), TYPE_QUAL_VOLATILE); - TREE_TYPE (field) = new; + new_type = build_qualified_type (TREE_TYPE (field), TYPE_QUAL_VOLATILE); + TREE_TYPE (field) = new_type; } h->field = field; diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index e960fa0..5fe460e 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -461,7 +461,7 @@ gfc_finish_decl (tree decl) static void gfc_finish_var_decl (tree decl, gfc_symbol * sym) { - tree new; + tree new_type; /* TREE_ADDRESSABLE means the address of this variable is actually needed. This is the equivalent of the TARGET variables. We also need to set this if the variable is passed by reference in a @@ -535,8 +535,8 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym) if (sym->attr.volatile_) { TREE_THIS_VOLATILE (decl) = 1; - new = build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE); - TREE_TYPE (decl) = new; + new_type = build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE); + TREE_TYPE (decl) = new_type; } /* Keep variables larger than max-stack-var-size off stack. */ diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index d4f5c59..568febc 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1460,9 +1460,9 @@ gfc_free_interface_mapping (gfc_interface_mapping * mapping) for (sym = mapping->syms; sym; sym = nextsym) { nextsym = sym->next; - gfc_free_symbol (sym->new->n.sym); + gfc_free_symbol (sym->new_sym->n.sym); gfc_free_expr (sym->expr); - gfc_free (sym->new); + gfc_free (sym->new_sym); gfc_free (sym); } for (cl = mapping->charlens; cl; cl = nextcl) @@ -1481,14 +1481,14 @@ static gfc_charlen * gfc_get_interface_mapping_charlen (gfc_interface_mapping * mapping, gfc_charlen * cl) { - gfc_charlen *new; + gfc_charlen *new_charlen; - new = gfc_get_charlen (); - new->next = mapping->charlens; - new->length = gfc_copy_expr (cl->length); + new_charlen = gfc_get_charlen (); + new_charlen->next = mapping->charlens; + new_charlen->length = gfc_copy_expr (cl->length); - mapping->charlens = new; - return new; + mapping->charlens = new_charlen; + return new_charlen; } @@ -1597,7 +1597,7 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping, sm = XCNEW (gfc_interface_sym_mapping); sm->next = mapping->syms; sm->old = sym; - sm->new = new_symtree; + sm->new_sym = new_symtree; sm->expr = gfc_copy_expr (expr); mapping->syms = sm; @@ -1689,10 +1689,10 @@ gfc_finish_interface_mapping (gfc_interface_mapping * mapping, gfc_se se; for (sym = mapping->syms; sym; sym = sym->next) - if (sym->new->n.sym->ts.type == BT_CHARACTER - && !sym->new->n.sym->ts.cl->backend_decl) + if (sym->new_sym->n.sym->ts.type == BT_CHARACTER + && !sym->new_sym->n.sym->ts.cl->backend_decl) { - expr = sym->new->n.sym->ts.cl->length; + expr = sym->new_sym->n.sym->ts.cl->length; gfc_apply_interface_mapping_to_expr (mapping, expr); gfc_init_se (&se, NULL); gfc_conv_expr (&se, expr); @@ -1701,7 +1701,7 @@ gfc_finish_interface_mapping (gfc_interface_mapping * mapping, gfc_add_block_to_block (pre, &se.pre); gfc_add_block_to_block (post, &se.post); - sym->new->n.sym->ts.cl->backend_decl = se.expr; + sym->new_sym->n.sym->ts.cl->backend_decl = se.expr; } } @@ -1931,8 +1931,8 @@ gfc_apply_interface_mapping_to_expr (gfc_interface_mapping * mapping, for (sym = mapping->syms; sym; sym = sym->next) if (expr->symtree && sym->old == expr->symtree->n.sym) { - if (sym->new->n.sym->backend_decl) - expr->symtree = sym->new; + if (sym->new_sym->n.sym->backend_decl) + expr->symtree = sym->new_sym; else if (sym->expr) gfc_replace_expr (expr, gfc_copy_expr (sym->expr)); } @@ -1964,9 +1964,9 @@ gfc_apply_interface_mapping_to_expr (gfc_interface_mapping * mapping, for (sym = mapping->syms; sym; sym = sym->next) if (sym->old == expr->value.function.esym) { - expr->value.function.esym = sym->new->n.sym; + expr->value.function.esym = sym->new_sym->n.sym; gfc_map_fcn_formal_to_actual (expr, sym->expr, mapping); - expr->value.function.esym->result = sym->new->n.sym; + expr->value.function.esym->result = sym->new_sym->n.sym; } break; diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 81c449e..d19c679 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -710,7 +710,7 @@ typedef struct gfc_interface_sym_mapping { struct gfc_interface_sym_mapping *next; gfc_symbol *old; - gfc_symtree *new; + gfc_symtree *new_sym; gfc_expr *expr; } gfc_interface_sym_mapping; -- 2.7.4