summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-18 13:40:54 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-18 13:40:54 +0000
commitaf694375ba567d73fc988296db9b5387a9fbfb64 (patch)
tree48d321513a6f0b49445946dd5e60ead3215660ad /gcc/cp/pt.c
parent23a7594e68d02525a266d8ac11fd85221f02d513 (diff)
downloadgcc-af694375ba567d73fc988296db9b5387a9fbfb64.tar.gz
* hashtable.h (struct ht_identifier): Add data member "hash_value".
* hashtable.c (ht_lookup): Use it when searching, remember. (ht_expand): Do not recompute. * tree.h (IDENTIFIER_HASH_VALUE): New macro. cp/ * cp-tree.h (struct lang_type_class): Replace data member tags with hash-table nested_udts. (CLASSTYPE_NESTED_UTDS): Rename from CLASSTYPE_TAGS. * class.c (unreverse_member_declarations): Don't touch CLASSTYPE_TAGS. (pushclass): Use cxx_remember_type_decls. * decl.c (struct cp_binding_level): Replace data member tags with hash-table type_decls. (pop_binding_level): Handle level->type_decls. (kept_level_p): Adjust. (poplevel): Remove unused local variable. (bt_print_entry): New function. (print_binding_level): Use it. (push_namespace): Build current_binding_level->type_decls. (maybe_process_template_type_declaration): Adjust. (pushtag): Likewise. (clear_anon_tags): Use binding_table_remove_anonymous_types. (gettags): Remove. (cxx_remember_type_decls): Rename from storetags. Adjust. (lookup_tag): Use binding_table_find_anon_type. Tidy. (lookup_tag_reverse): Use binding_table_reverse_maybe_remap. (cxx_init_decl_processing): Build global_binding_level->type_decls. (store_parm_decls): Remove pointless code. * name-lookup.c (free_binding_entry): New variable. (ENTRY_INDEX): New macro. (struct binding_table_s): New datatype. (binding_entry_make): New function. (binding_entry_free): Likewise. (binding_table_construct): Likewise. (binding_table_free): Likewise. (binding_table_new): Likewise. (binding_table_expand): Likewise. (binding_table_insert): Likewise. (binding_table_find): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (binding_table_remove_anonymous_types): Likewise. (binding_table_foreach): Likewise. * name-lookup.h (binding_table): New type. (binding_entry): Likewise. (bt_foreach_proc): Likewise. (struct binding_entry_s): New datatype. (SCOPE_DEFAULT_HT_SIZE): New macro. (CLASS_SCOPE_HT_SIZE): Likewise. (NAMESPACE_ORDINARY_HT_SIZE): Likewise. (NAMESPACE_STD_HT_SIZE): Likewise. (GLOBAL_SCOPE_HT_SIZE): Likewise. (binding_table_new): Declare. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (binding_table_remove_anonymous_types): Likewise. (binding_table_foreach): Likewise. (binding_table_find): Likewise. (cxx_remember_type_decls): Likewise. * pt.c (bt_instantiate_type_proc): New function. (do_type_instantiation): Use it. * search.c (lookup_field_r): Use binding_table_find. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66930 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index efc37740b0c..e7feab6de05 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5393,7 +5393,7 @@ instantiate_class_template (type)
{
if (TYPE_P (t))
{
- /* Build new CLASSTYPE_TAGS. */
+ /* Build new CLASSTYPE_NESTED_UTDS. */
tree tag = t;
tree name = TYPE_IDENTIFIER (tag);
@@ -5486,7 +5486,7 @@ instantiate_class_template (type)
/* If it is a TYPE_DECL for a class-scoped ENUMERAL_TYPE,
such a thing will already have been added to the field
list by tsubst_enum in finish_member_declaration in the
- CLASSTYPE_TAGS case above. */
+ CLASSTYPE_NESTED_UTDS case above. */
if (!(TREE_CODE (r) == TYPE_DECL
&& TREE_CODE (TREE_TYPE (r)) == ENUMERAL_TYPE
&& TYPE_CONTEXT (TREE_TYPE (r)) == type))
@@ -10470,6 +10470,18 @@ mark_class_instantiated (t, extern_p)
}
}
+/* Called from do_type_instantiation through binding_table_foreach to
+ do recursive instantiation for the type bound in ENTRY. */
+static void
+bt_instantiate_type_proc (binding_entry entry, void *data)
+{
+ tree storage = *(tree *) data;
+
+ if (IS_AGGR_TYPE (entry->type)
+ && !uses_template_parms (CLASSTYPE_TI_ARGS (entry->type)))
+ do_type_instantiation (TYPE_MAIN_DECL (entry->type), storage, 0);
+}
+
/* Perform an explicit instantiation of template class T. STORAGE, if
non-null, is the RID for extern, inline or static. COMPLAIN is
nonzero if this is called from the parser, zero if called recursively,
@@ -10610,10 +10622,9 @@ do_type_instantiation (t, storage, complain)
instantiate_decl (tmp, /*defer_ok=*/1);
}
- for (tmp = CLASSTYPE_TAGS (t); tmp; tmp = TREE_CHAIN (tmp))
- if (IS_AGGR_TYPE (TREE_VALUE (tmp))
- && !uses_template_parms (CLASSTYPE_TI_ARGS (TREE_VALUE (tmp))))
- do_type_instantiation (TYPE_MAIN_DECL (TREE_VALUE (tmp)), storage, 0);
+ if (CLASSTYPE_NESTED_UTDS (t))
+ binding_table_foreach (CLASSTYPE_NESTED_UTDS (t),
+ bt_instantiate_type_proc, &storage);
}
}