diff options
| author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-07 02:29:34 +0000 |
|---|---|---|
| committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-07 02:29:34 +0000 |
| commit | 1ae02380e04a0d87942ca2f6328614edf7aa655d (patch) | |
| tree | 9e44532889ee3de07440e82a17c4a52c51902938 | |
| parent | ff178c070e876b5708b769fb97a861579f2fc74c (diff) | |
| download | ppe42-gcc-1ae02380e04a0d87942ca2f6328614edf7aa655d.tar.gz ppe42-gcc-1ae02380e04a0d87942ca2f6328614edf7aa655d.zip | |
* decl.c (wrapup_globals_for_namespace): Use VEC instead of
VARRAY.
* name-lookup.c (add_decl_to_level, begin_scope): Likewise.
* name-lookup.h (cp_binding_level): Change the type of
static_decls to VEC(tree,gc)*.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99346 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 6 | ||||
| -rw-r--r-- | gcc/cp/name-lookup.c | 12 | ||||
| -rw-r--r-- | gcc/cp/name-lookup.h | 2 |
4 files changed, 18 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index afb3073609f..5b229ef2309 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2005-05-07 Kazu Hirata <kazu@cs.umass.edu> + + * decl.c (wrapup_globals_for_namespace): Use VEC instead of + VARRAY. + * name-lookup.c (add_decl_to_level, begin_scope): Likewise. + * name-lookup.h (cp_binding_level): Change the type of + static_decls to VEC(tree,gc)*. + 2005-05-06 Kazu Hirata <kazu@cs.umass.edu> * decl2.c (spew_debug): Remove. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index eb3bf4dfcf1..15f74c08d3f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -786,9 +786,9 @@ int wrapup_globals_for_namespace (tree namespace, void* data) { struct cp_binding_level *level = NAMESPACE_LEVEL (namespace); - varray_type statics = level->static_decls; - tree *vec = &VARRAY_TREE (statics, 0); - int len = VARRAY_ACTIVE_SIZE (statics); + VEC(tree,gc) *statics = level->static_decls; + tree *vec = VEC_address (tree, statics); + int len = VEC_length (tree, statics); int last_time = (data != 0); if (last_time) diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 78f83253390..0bb8888e8a3 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -546,7 +546,7 @@ add_decl_to_level (tree decl, cxx_scope *b) && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))) || (TREE_CODE (decl) == FUNCTION_DECL && (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl)))) - VARRAY_PUSH_TREE (b->static_decls, decl); + VEC_safe_push (tree, gc, b->static_decls, decl); } } @@ -1264,11 +1264,11 @@ begin_scope (scope_kind kind, tree entity) case sk_namespace: NAMESPACE_LEVEL (entity) = scope; - VARRAY_TREE_INIT (scope->static_decls, - DECL_NAME (entity) == std_identifier - || DECL_NAME (entity) == global_scope_name - ? 200 : 10, - "Static declarations"); + scope->static_decls = + VEC_alloc (tree, gc, + DECL_NAME (entity) == std_identifier + || DECL_NAME (entity) == global_scope_name + ? 200 : 10); break; default: diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index 5aeb80b7338..19bcec0eba6 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -188,7 +188,7 @@ struct cp_binding_level GTY(()) tree namespaces; /* An array of static functions and variables (for namespaces only) */ - varray_type static_decls; + VEC(tree,gc) *static_decls; /* A chain of VTABLE_DECL nodes. */ tree vtables; |

