c++: name lookup API for modules
authorNathan Sidwell <nathan@acm.org>
Thu, 10 Dec 2020 21:05:44 +0000 (13:05 -0800)
committerNathan Sidwell <nathan@acm.org>
Fri, 11 Dec 2020 14:44:26 +0000 (06:44 -0800)
commit37b242a3fbd29839ce352dfd8444c44989642a42
treed8acaa8e1d03759a1906997123e728720c9ba309
parent958d42abdf1a1936d290aab126cebd6bb4a52361
c++: name lookup API for modules

This adds a set of calls to name lookup that are needed by modules.
Generally installing imported bindings, or walking the current TU's
bindings.  One note about template instantiations though.  When we're
about to instantiate a template we have to know about all the
maybe-partial specializations that exist.  These can be in any
imported module -- not necesarily the module defining the template.
Thus we key such foreign templates to the innermost namespace and
identifier of the containing entitity -- that's the only thing we have
a handle on.  That's why we note and load pending specializations here.

gcc/cp/
* module.cc (lazy_specializations_p): Stub.
* name-lookup.h (append_imported_binding_slot)
(mergeable_namespacE_slots, lookup_class_binding)
(walk_module_binding, import_module_binding, set_module_binding)
(note_pending_specializations, load_pending_specializations)
(add_module_decl, add_imported_namespace): Declare.
(get_cxx_dialect_name): Declare.
(enum WMB_flags): New.
* name-lookup.c (append_imported_binding_slot)
(mergeable_namespacE_slots, lookup_class_binding)
(walk_module_binding, import_module_binding, set_module_binding)
(note_pending_specializations, load_pending_specializations)
(add_module_decl, add_imported_namespace): New.
(get_cxx_dialect_name): Make extern.
gcc/cp/module.cc
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h