diff options
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index eb2d36e..0dbda0b 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -7183,46 +7183,6 @@ gfc_get_type_attr_spec (symbol_attribute *attr, char *name) } -/* Assign a hash value for a derived type. The algorithm is that of - SDBM. The hashed string is '[module_name #] derived_name'. */ -static unsigned int -hash_value (gfc_symbol *sym) -{ - unsigned int hash = 0; - const char *c; - int i, len; - - /* Hash of the module or procedure name. */ - if (sym->module != NULL) - c = sym->module; - else if (sym->ns && sym->ns->proc_name - && sym->ns->proc_name->attr.flavor == FL_MODULE) - c = sym->ns->proc_name->name; - else - c = NULL; - - if (c) - { - len = strlen (c); - for (i = 0; i < len; i++, c++) - hash = (hash << 6) + (hash << 16) - hash + (*c); - - /* Disambiguate between 'a' in 'aa' and 'aa' in 'a'. */ - hash = (hash << 6) + (hash << 16) - hash + '#'; - } - - /* Hash of the derived type name. */ - len = strlen (sym->name); - c = sym->name; - for (i = 0; i < len; i++, c++) - hash = (hash << 6) + (hash << 16) - hash + (*c); - - /* Return the hash but take the modulus for the sake of module read, - even though this slightly increases the chance of collision. */ - return (hash % 100000000); -} - - /* Match the beginning of a derived type declaration. If a type name was the result of a function, then it is possible to have a symbol already to be known as a derived type yet have no components. */ @@ -7355,7 +7315,7 @@ gfc_match_derived_decl (void) if (!sym->hash_value) /* Set the hash for the compound name for this type. */ - sym->hash_value = hash_value (sym); + sym->hash_value = gfc_hash_value (sym); /* Take over the ABSTRACT attribute. */ sym->attr.abstract = attr.abstract; |