From: Jason Merrill Date: Thu, 21 Jun 2018 18:19:34 +0000 (-0400) Subject: Reduce garbage from push_to_top_level. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50200c65395c1db084043d3093886aaf4846c1b8;p=gcc.git Reduce garbage from push_to_top_level. * name-lookup.c (do_push_to_top_level): Don't allocate current_lang_base. (do_pop_from_top_level): Release current_lang_base. From-SVN: r261860 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 55e9e0b0fc3..18673c095af 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2018-06-21 Jason Merrill + * name-lookup.c (do_push_to_top_level): Don't allocate + current_lang_base. + (do_pop_from_top_level): Release current_lang_base. + Let -fmem-report see callers of cxx_make_type. * lex.c (cxx_make_type): Add MEM_STAT_DECL. (make_class_type): Likewise. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index ec001016d3e..a30c37428ad 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -6852,7 +6852,7 @@ do_push_to_top_level (void) scope_chain = s; current_function_decl = NULL_TREE; - vec_alloc (current_lang_base, 10); + current_lang_base = NULL; current_lang_name = lang_name_cplusplus; current_namespace = global_namespace; push_class_stack (); @@ -6872,7 +6872,7 @@ do_pop_from_top_level (void) invalidate_class_lookup_cache (); pop_class_stack (); - current_lang_base = 0; + release_tree_vector (current_lang_base); scope_chain = s->prev; FOR_EACH_VEC_SAFE_ELT (s->old_bindings, i, saved)