Commit 50200c65 by Jason Merrill Committed by Jason Merrill

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
parent 6ec04704
2018-06-21 Jason Merrill <jason@redhat.com> 2018-06-21 Jason Merrill <jason@redhat.com>
* 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. Let -fmem-report see callers of cxx_make_type.
* lex.c (cxx_make_type): Add MEM_STAT_DECL. * lex.c (cxx_make_type): Add MEM_STAT_DECL.
(make_class_type): Likewise. (make_class_type): Likewise.
......
...@@ -6852,7 +6852,7 @@ do_push_to_top_level (void) ...@@ -6852,7 +6852,7 @@ do_push_to_top_level (void)
scope_chain = s; scope_chain = s;
current_function_decl = NULL_TREE; current_function_decl = NULL_TREE;
vec_alloc (current_lang_base, 10); current_lang_base = NULL;
current_lang_name = lang_name_cplusplus; current_lang_name = lang_name_cplusplus;
current_namespace = global_namespace; current_namespace = global_namespace;
push_class_stack (); push_class_stack ();
...@@ -6872,7 +6872,7 @@ do_pop_from_top_level (void) ...@@ -6872,7 +6872,7 @@ do_pop_from_top_level (void)
invalidate_class_lookup_cache (); invalidate_class_lookup_cache ();
pop_class_stack (); pop_class_stack ();
current_lang_base = 0; release_tree_vector (current_lang_base);
scope_chain = s->prev; scope_chain = s->prev;
FOR_EACH_VEC_SAFE_ELT (s->old_bindings, i, saved) FOR_EACH_VEC_SAFE_ELT (s->old_bindings, i, saved)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment