c++: name-lookup refactoring
authorNathan Sidwell <nathan@acm.org>
Thu, 10 Dec 2020 14:54:37 +0000 (06:54 -0800)
committerNathan Sidwell <nathan@acm.org>
Thu, 10 Dec 2020 14:56:32 +0000 (06:56 -0800)
commit36d0108adfdd7d1123ac1a972ef04910af13137e
tree9f0dd4cde65f86161d7bbd5489ae07726d8fa1d1
parent237a8e8d5647e45aca2736906033291d49545a2c
c++: name-lookup refactoring

Here are some refactorings to the name-lookup machinery.  Primarily
breakout out worker functions that the modules patch will also use.
Fixing a couple of comments on the way.

gcc/cp/
* name-lookup.c (pop_local_binding): Check for IDENTIFIER_ANON_P.
(update_binding): Level may be null, don't add namespaces to
level.
(newbinding_bookkeeping): New, broken out of ...
(do_pushdecl): ... here, call it.  Don't push anonymous decls.
(pushdecl, add_using_namespace): Correct comments.
(do_push_nested_namespace): Remove assert.
(make_namespace, make_namespace_finish): New, broken out of ...
(push_namespace): ... here.  Call them.  Add namespace to level
here.
gcc/cp/name-lookup.c