aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2008-01-07 16:44:43 +0000
committerPaul Thomas <pault@gcc.gnu.org>2008-01-07 16:44:43 +0000
commit3a7b9fdaf63436ea0c43acc53457495bd36791b7 (patch)
tree933859f7a33a83b4eb1c2426b726575147920a81 /gcc/fortran/module.c
parentb61ea03d2dc7cb1852d1cf401a22f1f6935972ad (diff)
downloadgcc-3a7b9fdaf63436ea0c43acc53457495bd36791b7.zip
gcc-3a7b9fdaf63436ea0c43acc53457495bd36791b7.tar.gz
gcc-3a7b9fdaf63436ea0c43acc53457495bd36791b7.tar.bz2
re PR fortran/34672 (.mod file misses renamed, USEd symbol)
2008-01-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/34672 * module.c (write_generic): Rewrite completely. (write_module): Change call to write_generic. 2008-01-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/34672 * gfortran.dg/use_only_2.f90: New test. From-SVN: r131377
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');