diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2005-05-04 06:00:13 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-05-04 06:00:13 +0000 |
commit | 9acaf84abb649b3300f0c369f37be3b2804c5ee2 (patch) | |
tree | d0093f431b3c57f32a3455c9a6b9c7e260d1c27f | |
parent | 78da4d2e8476b54273d1d50a4d739d4f7d31732c (diff) | |
download | gcc-9acaf84abb649b3300f0c369f37be3b2804c5ee2.zip gcc-9acaf84abb649b3300f0c369f37be3b2804c5ee2.tar.gz gcc-9acaf84abb649b3300f0c369f37be3b2804c5ee2.tar.bz2 |
cp-tree.h (language_function): Change the type of x_local_names to VEC.
* cp-tree.h (language_function): Change the type of
x_local_names to VEC.
* decl.c (push_local_name): Adjust uses of local_names.
From-SVN: r99209
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 10 |
3 files changed, 11 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5813927..39d8675 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-05-04 Kazu Hirata <kazu@cs.umass.edu> + + * cp-tree.h (language_function): Change the type of + x_local_names to VEC. + * decl.c (push_local_name): Adjust uses of local_names. + 2005-05-03 Kazu Hirata <kazu@cs.umass.edu> * friend.c, lex.c, mangle.c, repo.c: Update copyright. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index b057581..b5eab93 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -750,7 +750,7 @@ struct language_function GTY(()) struct named_label_use_list *x_named_label_uses; struct named_label_list *x_named_labels; struct cp_binding_level *bindings; - varray_type x_local_names; + VEC(tree,gc) *x_local_names; }; /* The current C++-specific per-function global variables. */ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 91f57ef..eb3bf4d 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -832,15 +832,13 @@ push_local_name (tree decl) tree t, name; timevar_push (TV_NAME_LOOKUP); - if (!local_names) - VARRAY_TREE_INIT (local_names, 8, "local_names"); name = DECL_NAME (decl); - nelts = VARRAY_ACTIVE_SIZE (local_names); + nelts = VEC_length (tree, local_names); for (i = 0; i < nelts; i++) { - t = VARRAY_TREE (local_names, i); + t = VEC_index (tree, local_names, i); if (DECL_NAME (t) == name) { if (!DECL_LANG_SPECIFIC (decl)) @@ -851,13 +849,13 @@ push_local_name (tree decl) else DECL_DISCRIMINATOR (decl) = 1; - VARRAY_TREE (local_names, i) = decl; + VEC_replace (tree, local_names, i, decl); timevar_pop (TV_NAME_LOOKUP); return; } } - VARRAY_PUSH_TREE (local_names, decl); + VEC_safe_push (tree, gc, local_names, decl); timevar_pop (TV_NAME_LOOKUP); } |