diff options
| author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2005-02-07 23:16:13 +0100 |
|---|---|---|
| committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-02-07 23:16:13 +0100 |
| commit | 231b2fccf5b9ddc723e8c6e47758e3dc44d32427 (patch) | |
| tree | e57f670abf097dfcf0ab3eda1878922121626708 /gcc/fortran/decl.c | |
| parent | f55db9c2fc24eff6cdbaa621851a4382f6dea939 (diff) | |
| download | gcc-231b2fccf5b9ddc723e8c6e47758e3dc44d32427.zip gcc-231b2fccf5b9ddc723e8c6e47758e3dc44d32427.tar.gz gcc-231b2fccf5b9ddc723e8c6e47758e3dc44d32427.tar.bz2 | |
gfortran.h (gfc_add_dimension, [...]): Add argument.
* gfortran.h (gfc_add_dimension, gfc_add_result, gfc_add_save,
gfc_add_dummy, gfc_add_generic, gfc_add_in_common, gfc_add_data,
gfc_add_in_namelist, gfc_add_sequence, gfc_add_function,
gfc_add_subroutine, gfc_add_access, gfc_add_flavor, gfc_add_entry,
gfc_add_procedure): Add argument.
* array.c (gfc_set_array_spec), decl.c (var_element, get_proc_name,
gfc_match_null, match_type_spec, match_attr_spec,
gfc_match_formal_arglist, match_result, gfc_match_function_decl):
Update callers to match.
(gfc_match_entry) : Likewise, fix comment typo.
(gfc_match_subroutine, attr_decl1, gfc_add_dimension,
access_attr_decl, do_parm, gfc_match_save, gfc_match_modproc,
gfc_match_derived_decl): Update callers.
* interface.c (gfc_match_interface): Likewise.
* match.c (gfc_match_label, gfc_add_flavor,
gfc_match_call, gfc_match_common, gfc_match_block_data,
gfc_match_namelist, gfc_match_module, gfc_match_st_function):
Likewise.
* parse.c (parse_derived, parse_interface, parse_contained),
primary.c (gfc_match_rvalue, gfc_match_variable): Likewise.
* resolve.c (resolve_formal_arglist, resolve_entries): Update callers.
* symbol.c (check_conflict, check_used): Add new 'name' argument,
use when printing error message.
(gfc_add_dimension, gfc_add_result, gfc_add_save, gfc_add_dummy,
gfc_add_generic, gfc_add_in_common, gfc_add_data,
gfc_add_in_namelist, gfc_add_sequence, gfc_add_function,
gfc_add_subroutine, gfc_add_access, gfc_add_flavor, gfc_add_entry,
gfc_add_procedure): Add new 'name' argument. Pass along to
check_conflict and check_used.
(gfc_add_allocatable, gfc_add_external, gfc_add_intrinsic,
gfc_add_optional, gfc_add_pointer, gfc_add_target, gfc_add_elemental,
gfc_add_pure, gfc_add_recursive, gfc_add_intent,
gfc_add_explicit_interface, gfc_copy_attr): Pass NULL for new
argument in calls to any of the modified functions.
From-SVN: r94718
Diffstat (limited to 'gcc/fortran/decl.c')
| -rw-r--r-- | gcc/fortran/decl.c | 73 |
1 files changed, 40 insertions, 33 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 92326e7..9ad5ef1 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -198,7 +198,7 @@ var_element (gfc_data_variable * new) } #endif - if (gfc_add_data (&sym->attr, &new->expr->where) == FAILURE) + if (gfc_add_data (&sym->attr, sym->name, &new->expr->where) == FAILURE) return MATCH_ERROR; return MATCH_YES; @@ -598,7 +598,8 @@ get_proc_name (const char *name, gfc_symbol ** result) if (sym->ns->proc_name != NULL && sym->ns->proc_name->attr.flavor == FL_MODULE && sym->attr.proc != PROC_MODULE - && gfc_add_procedure (&sym->attr, PROC_MODULE, NULL) == FAILURE) + && gfc_add_procedure (&sym->attr, PROC_MODULE, + sym->name, NULL) == FAILURE) rc = 2; return rc; @@ -818,8 +819,9 @@ gfc_match_null (gfc_expr ** result) gfc_intrinsic_symbol (sym); if (sym->attr.proc != PROC_INTRINSIC - && (gfc_add_procedure (&sym->attr, PROC_INTRINSIC, NULL) == FAILURE - || gfc_add_function (&sym->attr, NULL) == FAILURE)) + && (gfc_add_procedure (&sym->attr, PROC_INTRINSIC, + sym->name, NULL) == FAILURE + || gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)) return MATCH_ERROR; e = gfc_get_expr (); @@ -1369,7 +1371,7 @@ match_type_spec (gfc_typespec * ts, int implicit_flag) } if (sym->attr.flavor != FL_DERIVED - && gfc_add_flavor (&sym->attr, FL_DERIVED, NULL) == FAILURE) + && gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL) == FAILURE) return MATCH_ERROR; ts->type = BT_DERIVED; @@ -1801,7 +1803,7 @@ match_attr_spec (void) break; case DECL_DIMENSION: - t = gfc_add_dimension (¤t_attr, &seen_at[d]); + t = gfc_add_dimension (¤t_attr, NULL, &seen_at[d]); break; case DECL_EXTERNAL: @@ -1829,7 +1831,7 @@ match_attr_spec (void) break; case DECL_PARAMETER: - t = gfc_add_flavor (¤t_attr, FL_PARAMETER, &seen_at[d]); + t = gfc_add_flavor (¤t_attr, FL_PARAMETER, NULL, &seen_at[d]); break; case DECL_POINTER: @@ -1837,15 +1839,17 @@ match_attr_spec (void) break; case DECL_PRIVATE: - t = gfc_add_access (¤t_attr, ACCESS_PRIVATE, &seen_at[d]); + t = gfc_add_access (¤t_attr, ACCESS_PRIVATE, NULL, + &seen_at[d]); break; case DECL_PUBLIC: - t = gfc_add_access (¤t_attr, ACCESS_PUBLIC, &seen_at[d]); + t = gfc_add_access (¤t_attr, ACCESS_PUBLIC, NULL, + &seen_at[d]); break; case DECL_SAVE: - t = gfc_add_save (¤t_attr, &seen_at[d]); + t = gfc_add_save (¤t_attr, NULL, &seen_at[d]); break; case DECL_TARGET: @@ -2080,7 +2084,7 @@ gfc_match_formal_arglist (gfc_symbol * progname, int st_flag, int null_flag) dummy procedure. We don't apply these attributes to formal arguments of statement functions. */ if (sym != NULL && !st_flag - && (gfc_add_dummy (&sym->attr, NULL) == FAILURE + && (gfc_add_dummy (&sym->attr, sym->name, NULL) == FAILURE || gfc_missing_attr (&sym->attr, NULL) == FAILURE)) { m = MATCH_ERROR; @@ -2180,8 +2184,8 @@ match_result (gfc_symbol * function, gfc_symbol ** result) if (gfc_get_symbol (name, NULL, &r)) return MATCH_ERROR; - if (gfc_add_flavor (&r->attr, FL_VARIABLE, NULL) == FAILURE - || gfc_add_result (&r->attr, NULL) == FAILURE) + if (gfc_add_flavor (&r->attr, FL_VARIABLE, r->name, NULL) == FAILURE + || gfc_add_result (&r->attr, r->name, NULL) == FAILURE) return MATCH_ERROR; *result = r; @@ -2251,7 +2255,7 @@ gfc_match_function_decl (void) /* Make changes to the symbol. */ m = MATCH_ERROR; - if (gfc_add_function (&sym->attr, NULL) == FAILURE) + if (gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE) goto cleanup; if (gfc_missing_attr (&sym->attr, NULL) == FAILURE @@ -2326,13 +2330,13 @@ gfc_match_entry (void) if (state == COMP_SUBROUTINE) { - /* And entry in a subroutine. */ + /* An entry in a subroutine. */ m = gfc_match_formal_arglist (entry, 0, 1); if (m != MATCH_YES) return MATCH_ERROR; - if (gfc_add_entry (&entry->attr, NULL) == FAILURE - || gfc_add_subroutine (&entry->attr, NULL) == FAILURE) + if (gfc_add_entry (&entry->attr, entry->name, NULL) == FAILURE + || gfc_add_subroutine (&entry->attr, entry->name, NULL) == FAILURE) return MATCH_ERROR; } else @@ -2346,8 +2350,8 @@ gfc_match_entry (void) if (gfc_match_eos () == MATCH_YES) { - if (gfc_add_entry (&entry->attr, NULL) == FAILURE - || gfc_add_function (&entry->attr, NULL) == FAILURE) + if (gfc_add_entry (&entry->attr, entry->name, NULL) == FAILURE + || gfc_add_function (&entry->attr, entry->name, NULL) == FAILURE) return MATCH_ERROR; entry->result = proc->result; @@ -2361,9 +2365,10 @@ gfc_match_entry (void) if (m != MATCH_YES) return MATCH_ERROR; - if (gfc_add_result (&result->attr, NULL) == FAILURE - || gfc_add_entry (&entry->attr, NULL) == FAILURE - || gfc_add_function (&entry->attr, NULL) == FAILURE) + if (gfc_add_result (&result->attr, result->name, NULL) == FAILURE + || gfc_add_entry (&entry->attr, result->name, NULL) == FAILURE + || gfc_add_function (&entry->attr, result->name, + NULL) == FAILURE) return MATCH_ERROR; } @@ -2426,7 +2431,7 @@ gfc_match_subroutine (void) return MATCH_ERROR; gfc_new_block = sym; - if (gfc_add_subroutine (&sym->attr, NULL) == FAILURE) + if (gfc_add_subroutine (&sym->attr, sym->name, NULL) == FAILURE) return MATCH_ERROR; if (gfc_match_formal_arglist (sym, 0, 1) != MATCH_YES) @@ -2713,7 +2718,7 @@ attr_decl1 (void) if ((current_attr.external || current_attr.intrinsic) && sym->attr.flavor != FL_PROCEDURE - && gfc_add_flavor (&sym->attr, FL_PROCEDURE, NULL) == FAILURE) + && gfc_add_flavor (&sym->attr, FL_PROCEDURE, sym->name, NULL) == FAILURE) { m = MATCH_ERROR; goto cleanup; @@ -2840,7 +2845,7 @@ gfc_match_dimension (void) { gfc_clear_attr (¤t_attr); - gfc_add_dimension (¤t_attr, NULL); + gfc_add_dimension (¤t_attr, NULL, NULL); return attr_decl (); } @@ -2893,7 +2898,7 @@ access_attr_decl (gfc_statement st) if (gfc_add_access (&sym->attr, (st == ST_PUBLIC) ? ACCESS_PUBLIC : ACCESS_PRIVATE, - NULL) == FAILURE) + sym->name, NULL) == FAILURE) return MATCH_ERROR; break; @@ -3036,7 +3041,7 @@ do_parm (void) } if (gfc_check_assign_symbol (sym, init) == FAILURE - || gfc_add_flavor (&sym->attr, FL_PARAMETER, NULL) == FAILURE) + || gfc_add_flavor (&sym->attr, FL_PARAMETER, sym->name, NULL) == FAILURE) { m = MATCH_ERROR; goto cleanup; @@ -3120,7 +3125,8 @@ gfc_match_save (void) switch (m) { case MATCH_YES: - if (gfc_add_save (&sym->attr, &gfc_current_locus) == FAILURE) + if (gfc_add_save (&sym->attr, sym->name, + &gfc_current_locus) == FAILURE) return MATCH_ERROR; goto next_item; @@ -3189,7 +3195,8 @@ gfc_match_modproc (void) return MATCH_ERROR; if (sym->attr.proc != PROC_MODULE - && gfc_add_procedure (&sym->attr, PROC_MODULE, NULL) == FAILURE) + && gfc_add_procedure (&sym->attr, PROC_MODULE, + sym->name, NULL) == FAILURE) return MATCH_ERROR; if (gfc_add_interface (sym) == FAILURE) @@ -3236,7 +3243,7 @@ loop: return MATCH_ERROR; } - if (gfc_add_access (&attr, ACCESS_PRIVATE, NULL) == FAILURE) + if (gfc_add_access (&attr, ACCESS_PRIVATE, NULL, NULL) == FAILURE) return MATCH_ERROR; goto loop; } @@ -3249,7 +3256,7 @@ loop: return MATCH_ERROR; } - if (gfc_add_access (&attr, ACCESS_PUBLIC, NULL) == FAILURE) + if (gfc_add_access (&attr, ACCESS_PUBLIC, NULL, NULL) == FAILURE) return MATCH_ERROR; goto loop; } @@ -3294,7 +3301,7 @@ loop: derived type that is a pointer. The first part of the AND clause is true if a the symbol is not the return value of a function. */ if (sym->attr.flavor != FL_DERIVED - && gfc_add_flavor (&sym->attr, FL_DERIVED, NULL) == FAILURE) + && gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL) == FAILURE) return MATCH_ERROR; if (sym->components != NULL) @@ -3306,7 +3313,7 @@ loop: } if (attr.access != ACCESS_UNKNOWN - && gfc_add_access (&sym->attr, attr.access, NULL) == FAILURE) + && gfc_add_access (&sym->attr, attr.access, sym->name, NULL) == FAILURE) return MATCH_ERROR; gfc_new_block = sym; |
