aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2005-02-12 16:44:01 +0100
committerTobias Schlüter <tobi@gcc.gnu.org>2005-02-12 16:44:01 +0100
commit1e6283cb21082d6f1b31e082087523f6f65ae021 (patch)
treebf34ab115582c30866172484900723c929f46e89 /gcc/fortran/symbol.c
parentd32707707a3a320f338839639c54227d97b95e5a (diff)
downloadgcc-1e6283cb21082d6f1b31e082087523f6f65ae021.zip
gcc-1e6283cb21082d6f1b31e082087523f6f65ae021.tar.gz
gcc-1e6283cb21082d6f1b31e082087523f6f65ae021.tar.bz2
symbol.c (gfc_use_ha_derived): Remove, fold functionality into ...
* symbol.c (gfc_use_ha_derived): Remove, fold functionality into ... (gfc_use_derived): ... this function. From-SVN: r94942
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index b8b6d5e..c9205d5 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -1201,14 +1201,17 @@ switch_types (gfc_symtree * st, gfc_symbol * from, gfc_symbol * to)
pointer to the translated node or NULL for an error. Usually there
is no translation and we return the node we were passed. */
-static gfc_symtree *
-gfc_use_ha_derived (gfc_symbol * sym)
+gfc_symbol *
+gfc_use_derived (gfc_symbol * sym)
{
gfc_symbol *s, *p;
gfc_typespec *t;
gfc_symtree *st;
int i;
+ if (sym->components != NULL)
+ return sym; /* Already defined. */
+
if (sym->ns->parent == NULL)
goto bad;
@@ -1251,7 +1254,7 @@ gfc_use_ha_derived (gfc_symbol * sym)
namelists, common lists and interface lists. */
gfc_free_symbol (sym);
- return st;
+ return s;
bad:
gfc_error ("Derived type '%s' at %C is being used before it is defined",
@@ -1260,22 +1263,6 @@ bad:
}
-gfc_symbol *
-gfc_use_derived (gfc_symbol * sym)
-{
- gfc_symtree *st;
-
- if (sym->components != NULL)
- return sym; /* Already defined */
-
- st = gfc_use_ha_derived (sym);
- if (st)
- return st->n.sym;
- else
- return NULL;
-}
-
-
/* Given a derived type node and a component name, try to locate the
component structure. Returns the NULL pointer if the component is
not found or the components are private. */