This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] sdbout.c: Use VEC instead of VARRAY.


Attached is a patch to use VEC instead of VARRAY.

Tested on i686-pc-linux-gnu.  I don't know if anybody is working in
this area, but I'll wait for 24 hours just in case before I check in
this patch.

Kazu Hirata

2005-05-01  Kazu Hirata  <>

	* sdbout.c (deferred_global_decls, sdbout_global_decl,
	sdbout_finish, sdbout_init): Use VEC instead of VARRAY.

Index: sdbout.c
RCS file: /cvs/gcc/gcc/gcc/sdbout.c,v
retrieving revision 1.101
diff -u -d -p -r1.101 sdbout.c
--- sdbout.c	31 Mar 2005 14:59:52 -0000	1.101
+++ sdbout.c	1 May 2005 00:39:02 -0000
@@ -58,7 +58,7 @@ static GTY(()) int unnamed_struct_number
 /* Declarations whose debug info was deferred till end of compilation.  */
-static GTY(()) varray_type deferred_global_decls;
+static GTY(()) VEC(tree,gc) *deferred_global_decls;
 /* The C front end may call sdbout_symbol before sdbout_init runs.
    We save all such decls in this list and output them when we get
@@ -1451,7 +1451,7 @@ sdbout_global_decl (tree decl)
       if (!DECL_INITIAL (decl) || !TREE_PUBLIC (decl))
 	sdbout_symbol (decl, 0);
-	VARRAY_PUSH_TREE (deferred_global_decls, decl);
+	VEC_safe_push (tree, gc, deferred_global_decls, decl);
       /* Output COFF information for non-global file-scope initialized
 	 variables.  */
@@ -1467,9 +1467,10 @@ static void
 sdbout_finish (const char *main_filename ATTRIBUTE_UNUSED)
   size_t i;
+  tree decl;
-  for (i = 0; i < VARRAY_ACTIVE_SIZE (deferred_global_decls); i++)
-    sdbout_symbol (VARRAY_TREE (deferred_global_decls, i), 0);
+  for (i = 0; VEC_iterate (tree, deferred_global_decls, i, decl); i++)
+    sdbout_symbol (decl, 0);
 /* Describe the beginning of an internal block within a function.
@@ -1674,7 +1675,7 @@ sdbout_init (const char *input_file_name
   current_file->name = input_file_name;
-  VARRAY_TREE_INIT (deferred_global_decls, 12, "deferred_global_decls");
+  deferred_global_decls = VEC_alloc (tree, gc, 12);
   /* Emit debug information which was queued by sdbout_symbol before
      we got here.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]