aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 20528cb..20cec83 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -4176,13 +4176,22 @@ write_operator (gfc_user_op *uop)
}
-/* Write generic interfaces associated with a symbol. */
+/* Write generic interfaces from the namespace sym_root. */
static void
-write_generic (gfc_symbol *sym)
+write_generic (gfc_symtree *st)
{
- const char *p;
- int nuse, j;
+ gfc_symbol *sym;
+
+ if (st == NULL)
+ return;
+
+ write_generic (st->left);
+ write_generic (st->right);
+
+ sym = st->n.sym;
+ if (!sym || check_unique_name (st->name))
+ return;
if (sym->generic == NULL
|| !gfc_check_access (sym->attr.access, sym->ns->default_access))
@@ -4191,21 +4200,7 @@ write_generic (gfc_symbol *sym)
if (sym->module == NULL)
sym->module = gfc_get_string (module_name);
- /* See how many use names there are. If none, use the symbol name. */
- nuse = number_use_names (sym->name, false);
- if (nuse == 0)
- {
- mio_symbol_interface (&sym->name, &sym->module, &sym->generic);
- return;
- }
-
- for (j = 1; j <= nuse; j++)
- {
- /* Get the jth local name for this symbol. */
- p = find_use_name_n (sym->name, &j, false);
-
- mio_symbol_interface (&p, &sym->module, &sym->generic);
- }
+ mio_symbol_interface (&st->name, &sym->module, &sym->generic);
}
@@ -4263,7 +4258,7 @@ write_module (void)
write_char ('\n');
mio_lparen ();
- gfc_traverse_ns (gfc_current_ns, write_generic);
+ write_generic (gfc_current_ns->sym_root);
mio_rparen ();
write_char ('\n');
write_char ('\n');