summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2005-05-02 18:36:24 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2005-05-02 18:36:24 +0000
commit806aa9014b8ce5c3d896ff8cde6ef5021bd73043 (patch)
treefe84fa00e06e1b8c8289fa2592d1384c032ce778 /gcc/cp
parenta6e4d85b506e3424a02c752661b47e35efe1ee05 (diff)
downloadgcc-806aa9014b8ce5c3d896ff8cde6ef5021bd73043.tar.gz
class.c (local_classes, [...]): Use VEC instead of VARRAY.
* 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. From-SVN: r99115
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/class.c4
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/mangle.c2
-rw-r--r--gcc/cp/name-lookup.c2
5 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a3c529ed011..b0f06967db2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2005-05-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * 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 <bonzini@gnu.org>
* semantics.c (finish_call_expr): Call resolve_overloaded_builtin
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 5052aaaf6b0..89ae74ff91c 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 87129241f35..53f19f27c9a 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 20be571408b..15a42b1a897 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 634645d7fa4..67288d7c277 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))