decl.c (wrapup_globals_for_namespace): Use VEC instead of VARRAY.
authorKazu Hirata <kazu@cs.umass.edu>
Sat, 7 May 2005 02:29:34 +0000 (02:29 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sat, 7 May 2005 02:29:34 +0000 (02:29 +0000)
* 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)*.

From-SVN: r99346

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h

index afb3073609f5e4ee71126b47d2f1e6089474fcd9..5b229ef230950e1a09f8e241c7c10f539a3e2667 100644 (file)
@@ -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.
index eb3bf4dfcf1e97245c400e6fe393ab016b005cca..15f74c08d3fa92992998a3d183c7ecdbc22065dc 100644 (file)
@@ -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)
index 78f83253390c5fae1b17a8f954c5abc03c954ae3..0bb8888e8a3871bbb503b1723ec38233284c583d 100644 (file)
@@ -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:
index 5aeb80b7338e583ee8d21bbfcfde12814702eb90..19bcec0eba60d513b73d6ad61bbacf43ae989065 100644 (file)
@@ -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;