aboutsummaryrefslogtreecommitdiff
path: root/gcc/vec.h
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-12-02 05:52:14 -0800
committerNathan Sidwell <nathan@acm.org>2020-12-02 06:19:43 -0800
commit05f7a2afe8fac98fb3e70ccd4128e6a2ffd7c817 (patch)
tree2753d28aa61361463b46bf83033ed9ca2a5c478f /gcc/vec.h
parent6725994fe99a75728b408ef104ae354df673ed69 (diff)
downloadgcc-05f7a2afe8fac98fb3e70ccd4128e6a2ffd7c817.zip
gcc-05f7a2afe8fac98fb3e70ccd4128e6a2ffd7c817.tar.gz
gcc-05f7a2afe8fac98fb3e70ccd4128e6a2ffd7c817.tar.bz2
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.
Diffstat (limited to 'gcc/vec.h')
0 files changed, 0 insertions, 0 deletions