]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stor-layout.c (pending_sizes): Change the type to VEC(tree,gc) *.
authorSteven Bosscher <steven@gcc.gnu.org>
Wed, 5 May 2010 21:32:44 +0000 (21:32 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Wed, 5 May 2010 21:32:44 +0000 (21:32 +0000)
* stor-layout.c (pending_sizes): Change the type to
VEC(tree,gc) *.
(get_pending_sizes, put_pending_size, put_pending_sizes):
Update the uses of pending_sizes.
* c-decl.c (store_parm_decls): Likewise.
* c-tree.h (struct c_arg_info): Likewise.
* tree.h: Update the prototype for get_pending_sizes and
put_pending_sizes.

From-SVN: r159085

gcc/ChangeLog
gcc/c-decl.c
gcc/c-tree.h
gcc/stor-layout.c
gcc/tree.h

index aef0c30782b13ead3fbdf57c5ca75d8ae9ebe3cf..774d7c85c9b6ba9f9aeb850a50255637ca23b518 100644 (file)
@@ -1,3 +1,14 @@
+2010-05-05  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * stor-layout.c (pending_sizes): Change the type to
+       VEC(tree,gc) *.
+       (get_pending_sizes, put_pending_size, put_pending_sizes):
+       Update the uses of pending_sizes.
+       * c-decl.c (store_parm_decls): Likewise.
+       * c-tree.h (struct c_arg_info): Likewise.
+       * tree.h: Update the prototype for get_pending_sizes and
+       put_pending_sizes.
+
 2010-05-05  Jason Merrill  <jason@redhat.com>
 
        PR debug/43370
index 230b4aada9468f2741f2c2df1452c6dfcdbc4843..dd07b6582d847c96fd972bbcdfc335b0dcdef42f 100644 (file)
@@ -7990,9 +7990,12 @@ store_parm_decls (void)
      thus won't naturally see the SAVE_EXPR containing the increment.  All
      other pending sizes would be handled by gimplify_parameters.  */
   {
+    VEC(tree,gc) *pending_sizes = get_pending_sizes ();
     tree t;
-    for (t = nreverse (get_pending_sizes ()); t ; t = TREE_CHAIN (t))
-      add_stmt (TREE_VALUE (t));
+    int i;
+
+    for (i = 0; VEC_iterate (tree, pending_sizes, i, t); i++)
+      add_stmt (t);
   }
 
   /* Even though we're inside a function body, we still don't want to
index 50ed9db08a8beac4a7d68da5227169be26bc7a7a..3090a6738426be7eda9b83ebcb7ab0ea72c06feb 100644 (file)
@@ -306,11 +306,11 @@ struct c_arg_info {
   /* A list of non-parameter decls (notably enumeration constants)
      defined with the parameters.  */
   tree others;
-  /* A list of VLA sizes from the parameters.  In a function
+  /* A VEC of VLA sizes from the parameters.  In a function
      definition, these are used to ensure that side-effects in sizes
      of arrays converted to pointers (such as a parameter int i[n++])
      take place; otherwise, they are ignored.  */
-  tree pending_sizes;
+  VEC(tree,gc) *pending_sizes;
   /* True when these arguments had [*].  */
   BOOL_BITFIELD had_vla_unspec : 1;
 };
index 151092c06a4af9e667a2362e2e4668b5afb595cc..20b03a8acace9bda81fdc9961a4738e212ac57e1 100644 (file)
@@ -69,7 +69,7 @@ extern void debug_rli (record_layout_info);
 \f
 /* SAVE_EXPRs for sizes of types and decls, waiting to be expanded.  */
 
-static GTY(()) tree pending_sizes;
+static GTY(()) VEC(tree,gc) *pending_sizes;
 
 /* Show that REFERENCE_TYPES are internal and should use address_mode.
    Called only by front end.  */
@@ -80,12 +80,12 @@ internal_reference_types (void)
   reference_types_internal = 1;
 }
 
-/* Get a list of all the objects put on the pending sizes list.  */
+/* Get a VEC of all the objects put on the pending sizes list.  */
 
-tree
+VEC(tree,gc) *
 get_pending_sizes (void)
 {
-  tree chain = pending_sizes;
+  VEC(tree,gc) *chain = pending_sizes;
 
   pending_sizes = 0;
   return chain;
@@ -101,14 +101,14 @@ put_pending_size (tree expr)
   expr = skip_simple_arithmetic (expr);
 
   if (TREE_CODE (expr) == SAVE_EXPR)
-    pending_sizes = tree_cons (NULL_TREE, expr, pending_sizes);
+    VEC_safe_push (tree, gc, pending_sizes, expr);
 }
 
 /* Put a chain of objects into the pending sizes list, which must be
    empty.  */
 
 void
-put_pending_sizes (tree chain)
+put_pending_sizes (VEC(tree,gc) *chain)
 {
   gcc_assert (!pending_sizes);
   pending_sizes = chain;
index 0a16c0df004483736d271740aa943e82e81a8688..4e5ef70da8bb4d448ada0cb97d00ecb9f1eb2d9c 100644 (file)
@@ -4424,9 +4424,9 @@ extern tree size_diffop_loc (location_t, tree, tree);
 extern tree round_up_loc (location_t, tree, int);
 #define round_down(T,N) round_down_loc (UNKNOWN_LOCATION, T, N)
 extern tree round_down_loc (location_t, tree, int);
-extern tree get_pending_sizes (void);
+extern VEC(tree,gc) *get_pending_sizes (void);
 extern void put_pending_size (tree);
-extern void put_pending_sizes (tree);
+extern void put_pending_sizes (VEC(tree,gc) *);
 extern void finalize_size_functions (void);
 
 /* Type for sizes of data-type.  */