From aff447417f3d5cd331129f0646d5da16e915b3fe Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 2 May 2005 20:49:16 +0000 Subject: [PATCH] class.c (current_lang_depth, [...]): Use VEC instead of VARRAY. * class.c (current_lang_depth, push_lang_context, pop_lang_context): Use VEC instead of VARRAY. * cp-tree.h (saved_scope): Use VEC for lang_base instead of VARRAY. * name-lookup.c (push_to_top_level): Use VEC instead of VARRAY. From-SVN: r99121 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/class.c | 7 +++---- gcc/cp/cp-tree.h | 2 +- gcc/cp/name-lookup.c | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b0f06967db2..ee526e2ec13 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -6,6 +6,13 @@ * mangle.c (discriminator_for_local_entity): Likewise. * name-lookup.c (pushtag): Likewise. + * class.c (current_lang_depth, push_lang_context, + pop_lang_context): Use VEC instead of VARRAY. + * cp-tree.h (saved_scope): Use VEC for lang_base instead of + VARRAY. + * name-lookup.c (push_to_top_level): Use VEC instead of + VARRAY. + 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 89ae74ff91c..6217a2cce7f 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5523,7 +5523,7 @@ pop_nested_class (void) int current_lang_depth (void) { - return VARRAY_ACTIVE_SIZE (current_lang_base); + return VEC_length (tree, current_lang_base); } /* Set global variables CURRENT_LANG_NAME to appropriate value @@ -5532,7 +5532,7 @@ current_lang_depth (void) void push_lang_context (tree name) { - VARRAY_PUSH_TREE (current_lang_base, current_lang_name); + VEC_safe_push (tree, gc, current_lang_base, current_lang_name); if (name == lang_name_cplusplus) { @@ -5567,8 +5567,7 @@ push_lang_context (tree name) void pop_lang_context (void) { - current_lang_name = VARRAY_TOP_TREE (current_lang_base); - VARRAY_POP (current_lang_base); + current_lang_name = VEC_pop (tree, current_lang_base); } /* Type instantiation routines. */ diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 53f19f27c9a..b057581b034 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -659,7 +659,7 @@ struct saved_scope GTY(()) tree class_type; tree access_specifier; tree function_decl; - varray_type lang_base; + VEC(tree,gc) *lang_base; tree lang_name; tree template_parms; struct cp_binding_level *x_previous_class_level; diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 67288d7c277..78f83253390 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4864,7 +4864,7 @@ push_to_top_level (void) scope_chain = s; current_function_decl = NULL_TREE; - VARRAY_TREE_INIT (current_lang_base, 10, "current_lang_base"); + current_lang_base = VEC_alloc (tree, gc, 10); current_lang_name = lang_name_cplusplus; current_namespace = global_namespace; timevar_pop (TV_NAME_LOOKUP); -- 2.30.2