class.c (current_lang_depth, [...]): Use VEC instead of VARRAY.
authorKazu Hirata <kazu@cs.umass.edu>
Mon, 2 May 2005 20:49:16 +0000 (20:49 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Mon, 2 May 2005 20:49:16 +0000 (20:49 +0000)
* 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
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/name-lookup.c

index b0f06967db243c449051d4bb90e6a9409b0f6587..ee526e2ec1398fb56849ebe12a45987fbf3556d1 100644 (file)
@@ -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  <bonzini@gnu.org>
 
         * semantics.c (finish_call_expr): Call resolve_overloaded_builtin
index 89ae74ff91cf16886ccef7ffb238db9e9b7b4ff3..6217a2cce7f793c8d03db08f8af8d0fd868c5061 100644 (file)
@@ -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);
 }
 \f
 /* Type instantiation routines.  */
index 53f19f27c9a36828499af2ad99a6ec5dcc3cd75f..b057581b0340d78bb5b453653afae7b3c2ba7c84 100644 (file)
@@ -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;
index 67288d7c27780c5321a8422c4fff560c312d334d..78f83253390c5fae1b17a8f954c5abc03c954ae3 100644 (file)
@@ -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);