Reduce memory consumption for push/pop_access_scope.
authorJason Merrill <jason@redhat.com>
Sat, 20 Jul 2019 13:48:38 +0000 (09:48 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 20 Jul 2019 13:48:38 +0000 (09:48 -0400)
commit1ab1f3502038323f6f5cd8c16c0ac1b1416e3545
tree2728d6a496766f5f19f687cb4c31bd09a0435041
parent554a530ff81870098572832eed8ca00b3593bb41
Reduce memory consumption for push/pop_access_scope.

I was seeing memory consumption issues on the concepts-cxx2a
branch. push_scope was, surprisingly, at the top of -fmem-report, and
push_access_scope was pretty high.  Fixing them was pretty simple.

* name-lookup.c (leave_scope): Do add class levels other than
previous_class_level to free_binding_level.
(invalidate_class_lookup_cache): Move from class.c, add to
free_binding_level.
* pt.c (saved_access_scope): Change from list to vec.

From-SVN: r273622
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/name-lookup.c
gcc/cp/pt.c