diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-03-19 02:41:03 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-03-18 21:41:03 -0500 |
commit | 78957a2a8c2ba7a446029dc32830d415b565334e (patch) | |
tree | 33202a7b44623f5035ed5e7b39632801841a9004 /gcc | |
parent | 321c0828275afc28ac94cfe0f4f6ee50b4edad70 (diff) | |
download | gcc-78957a2a8c2ba7a446029dc32830d415b565334e.zip gcc-78957a2a8c2ba7a446029dc32830d415b565334e.tar.gz gcc-78957a2a8c2ba7a446029dc32830d415b565334e.tar.bz2 |
decl.c (store_bindings): Use free_binding_vecs.
* decl.c (store_bindings): Use free_binding_vecs.
(pop_from_top_level): Likewise.
From-SVN: r18701
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 22 |
2 files changed, 24 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b8269f3..5c45847 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com> + + * decl.c (store_bindings): Use free_binding_vecs. + (pop_from_top_level): Likewise. + Wed Mar 18 12:41:43 1998 Jason Merrill <jason@yorick.cygnus.com> * decl.c (make_implicit_typename): Only change the type of a diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 80fc959..09ad59c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1897,6 +1897,11 @@ struct saved_scope { }; static struct saved_scope *current_saved_scope; +/* A chain of the binding vecs created by store_bindings. We create a + whole bunch of these during compilation, on permanent_obstack, so we + can't just throw them away. */ +static tree free_binding_vecs; + static tree store_bindings (names, old_bindings) tree names, old_bindings; @@ -1919,8 +1924,15 @@ store_bindings (names, old_bindings) for (t1 = old_bindings; t1; t1 = TREE_CHAIN (t1)) if (TREE_VEC_ELT (t1, 0) == id) goto skip_it; - - binding = make_tree_vec (4); + + if (free_binding_vecs) + { + binding = free_binding_vecs; + free_binding_vecs = TREE_CHAIN (free_binding_vecs); + } + else + binding = make_tree_vec (4); + if (id) { my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 135); @@ -2045,8 +2057,9 @@ pop_from_top_level () current_binding_level = s->old_binding_level; current_saved_scope = s->prev; - for (t = s->old_bindings; t; t = TREE_CHAIN (t)) + for (t = s->old_bindings; t; ) { + tree save = t; tree id = TREE_VEC_ELT (t, 0); if (id) { @@ -2054,6 +2067,9 @@ pop_from_top_level () IDENTIFIER_LOCAL_VALUE (id) = TREE_VEC_ELT (t, 2); IDENTIFIER_CLASS_VALUE (id) = TREE_VEC_ELT (t, 3); } + t = TREE_CHAIN (t); + TREE_CHAIN (save) = free_binding_vecs; + free_binding_vecs = save; } current_class_name = s->class_name; current_class_type = s->class_type; |