C++ Module Binding Vector
This adds the vector necessary to hold different module's namespace
bindings. We add a new tree-node 'tree_binding_vec', which contains a
sparse array, indexed by module number. To avoid space wasting, this
is allocated in clusters using 'unsigned short' as the index value (so
that's one of the upper bounds on module importing). If there are
only bindings from the current TU, there is no vector, so we have the
same representation as a non-module compilation.
To support lazy loading, a binding slot can contain either a tree (the
binding), or a cookie that the module machinery uses to load the
required binding on demand.
The first 2 or 3 slots end up being reserved for fixed meanings.
There are a couple of flags we have to record on a binding, to know
whether the same declaration could appear in two different slots.
gcc/cp/
* cp-tree.def (BINDING_VECTOR): New.
* name-lookup.h (struct binding_slot): New.
(BINDING_VECTOR_SLOTS_PER_CLUSTER): New.
(struct binding_index, struct binding_cluster): New.
(BINDING_VECTOR_ALLOC_CLUSTERS, BINDING_VECTOR_CLUSTER_BASE)
(BINDING_VECTOR_CLUSTER): New.
(struct tree_binding_vec): New.
(BINDING_VECTOR_NAME, BINDING_VECTOR_GLOBAL_DUPS_P)
(BINDING_VECTOR_PARTITION_DUPS_P): New.
(BINDING_BINDING_GLOBAL_P, BINDING_BINDING_PARTITION_P): New.
(BINDING_VECTOR_PENDING_SPECIALIZATIONS)
(BINDING_VECTOR_PENDING_IS_HEADER_P)
(BINDING_VECTOR_PENDING_IS_PARTITION_P): New.
* cp-tree.h (enum cp_tree_node_structure_enum): Add
TS_CP_BINDING_VECTOR.
(union lang_tree_node): Add binding_vec field.
(make_binding_vec): Declare.
(named_decl_hash::hash, named_decl_hash::equal): Check for binding
vector.
* decl.c (cp_tree_node_structure): Add BINDING_VECTOR case.
* ptree.c (cxx_print_xnode): Add BINDING_VECTOR case.
* tree.c (make_binding_vec): New.