From 836c012512928660f99775081e13475b297972f7 Mon Sep 17 00:00:00 2001 From: kazu Date: Mon, 2 May 2005 18:36:24 +0000 Subject: [PATCH] * class.c (local_classes, init_class_processing): Use VEC instead of VARRAY. * cp-tree.h (local_classes): Likewise. * mangle.c (discriminator_for_local_entity): Likewise. * name-lookup.c (pushtag): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99115 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/class.c | 4 ++-- gcc/cp/cp-tree.h | 2 +- gcc/cp/mangle.c | 2 +- gcc/cp/name-lookup.c | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a3c529e..b0f0696 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2005-05-02 Kazu Hirata + + * class.c (local_classes, init_class_processing): Use VEC + instead of VARRAY. + * cp-tree.h (local_classes): Likewise. + * mangle.c (discriminator_for_local_entity): Likewise. + * name-lookup.c (pushtag): Likewise. + 2005-05-02 Paolo Bonzini * semantics.c (finish_call_expr): Call resolve_overloaded_builtin diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 5052aaa..89ae74f 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -104,7 +104,7 @@ static class_stack_node_t current_class_stack; /* An array of all local classes present in this translation unit, in declaration order. */ -varray_type local_classes; +VEC(tree,gc) *local_classes; static tree get_vfield_name (tree); static void finish_struct_anon (tree); @@ -5324,7 +5324,7 @@ init_class_processing (void) current_class_stack_size = 10; current_class_stack = xmalloc (current_class_stack_size * sizeof (struct class_stack_node)); - VARRAY_TREE_INIT (local_classes, 8, "local_classes"); + local_classes = VEC_alloc (tree, gc, 8); ridpointers[(int) RID_PUBLIC] = access_public_node; ridpointers[(int) RID_PRIVATE] = access_private_node; diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 8712924..53f19f2 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3132,7 +3132,7 @@ extern int current_class_depth; /* An array of all local classes present in this translation unit, in declaration order. */ -extern GTY(()) varray_type local_classes; +extern GTY(()) VEC(tree,gc) *local_classes; /* Here's where we control how name mangling takes place. */ diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 20be571..15a42b1 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1436,7 +1436,7 @@ discriminator_for_local_entity (tree entity) { /* Scan the list of local classes. */ entity = TREE_TYPE (entity); - for (type = &VARRAY_TREE (local_classes, 0); *type != entity; ++type) + for (type = VEC_address (tree, local_classes); *type != entity; ++type) if (TYPE_IDENTIFIER (*type) == TYPE_IDENTIFIER (entity) && TYPE_CONTEXT (*type) == TYPE_CONTEXT (entity)) ++discriminator; diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 634645d..67288d7 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4701,7 +4701,7 @@ pushtag (tree name, tree type, tag_scope scope) if (TYPE_CONTEXT (type) && TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL && !processing_template_decl) - VARRAY_PUSH_TREE (local_classes, type); + VEC_safe_push (tree, gc, local_classes, type); } if (b->kind == sk_class && !COMPLETE_TYPE_P (current_class_type)) -- 2.7.4