c++: Kill nested_udts
During the implementation of modules I added myself a note to
implement nested_udt handling. It wasn't obvious to me what they were
for and nothing seemed to be broken in ignoring them. I figured
something would eventually pop up and I'd add support. Nothing popped up.
Investigating on trunk discovered 3 places where we look at the
nested-udts. I couldn't figure how the one in lookup_field_r was
needed -- surely the regular lookup would find the type. It turned
out that code was unreachable. So we can delete it.
Next in do_type_instantiation, we walk the nested-utd table
instantiating types. But those types are also on the TYPE_FIELDS
list, which we've just iterated over. So I can move the handling into
that loop.
The final use is in handling structs that have a typedef name for
linkage purposes. Again, we can just iterate over TYPE_FIELDS. (As
commented, we probably don't need to do even that, as a DR, whose
number I forget, requires such structs to only have C-like things in
them. But I didn't go that far.
Having removed all the uses of nested-udts, I can remove their
creation from name-lookup, and as the only instance of a binding_table
object, we can remove all that code too.
gcc/cp/
* cp-tree.h (struct lang_type): Delete nested_udts field.
(CLASSTYPE_NESTED_UTDS): Delete.
* name-lookup.h (binding_table, binding_entry): Delete typedefs.
(bt_foreach_proc): Likewise.
(struct binding_entry_s): Delete.
(SCOPE_DEFAULT_HT_SIZE, CLASS_SCOPE_HT_SIZE)
(NAMESPACE_ORDINARY_HT_SIZE, NAMESPACE_STD_HT_SIZE)
(GLOBAL_SCOPE_HT_SIZE): Delete.
(binding_table_foreach, binding_table_find): Delete declarations.
* name-lookup.c (ENTRY_INDEX): Delete.
(free_binding_entry): Delete.
(binding_entry_make, binding_entry_free): Delete.
(struct binding_table_s): Delete.
(binding_table_construct, binding_table_free): Delete.
(binding_table_new, binding_table_expand): Delete.
(binding_table_insert, binding_table_find): Delete.
(binding_table_foreach): Delete.
(maybe_process_template_type_declaration): Delete
CLASSTYPE_NESTED_UTDS insertion.
(do_pushtag): Likewise.
* decl2.c (bt_reset_linkage_1): Fold into reset_type_linkage_1.
(reset_type_linkage_2, bt_reset_linkage_2): Fold into
reset_type_linkage.
* pt.c (instantiate_class_template_1): Delete NESTED_UTDs comment.
(bt_instantiate_type_proc): Delete.
(do_type_instantiation): Instantiate implicit typedef fields.
Delete NESTED_UTD walk.
* search.c (lookup_field_r): Delete unreachable NESTED_UTD
search.