tree-inline.c (cfun_stack): Change the type to VEC(function_p,heap).
authorKazu Hirata <kazu@cs.umass.edu>
Sat, 28 May 2005 15:43:14 +0000 (15:43 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sat, 28 May 2005 15:43:14 +0000 (15:43 +0000)
* tree-inline.c (cfun_stack): Change the type to
VEC(function_p,heap).
(push_cfun, pop_cfun): Use VEC instead of VARRAY.

From-SVN: r100294

gcc/ChangeLog
gcc/tree-inline.c

index f046e635712f6f80e31faf428cff44278188abe3..aa55a95e4a901827e35d61cfbd316f18c217e3de 100644 (file)
@@ -9,6 +9,10 @@
        (simplify_cond_and_lookup_avail_expr, record_range): Update
        uses of VRP records.
 
+       * tree-inline.c (cfun_stack): Change the type to
+       VEC(function_p,heap).
+       (push_cfun, pop_cfun): Use VEC instead of VARRAY.
+
 2005-05-27  Ian Lance Taylor  <ian@airs.com>
 
        * c-decl.c (add_stmt): Add C frontend specific version.
index 3c6b98f66f9013e6295d58f5f25105f5b6222bff..224004e0ebdb28bb7b74033ef20d9d39b1b4deb6 100644 (file)
@@ -1813,28 +1813,25 @@ estimate_num_insns (tree expr)
   return num;
 }
 
+typedef struct function *function_p;
+
+DEF_VEC_P(function_p);
+DEF_VEC_ALLOC_P(function_p,heap);
+
 /* Initialized with NOGC, making this poisonous to the garbage collector.  */
-static varray_type cfun_stack;
+static VEC(function_p,heap) *cfun_stack;
 
 void
 push_cfun (struct function *new_cfun)
 {
-  static bool initialized = false;
-
-  if (!initialized)
-    {
-      VARRAY_GENERIC_PTR_NOGC_INIT (cfun_stack, 20, "cfun_stack");
-      initialized = true;
-    }
-  VARRAY_PUSH_GENERIC_PTR (cfun_stack, cfun);
+  VEC_safe_push (function_p, heap, cfun_stack, cfun);
   cfun = new_cfun;
 }
 
 void
 pop_cfun (void)
 {
-  cfun = (struct function *)VARRAY_TOP_GENERIC_PTR (cfun_stack);
-  VARRAY_POP (cfun_stack);
+  cfun = VEC_pop (function_p, cfun_stack);
 }
 
 /* Install new lexical TREE_BLOCK underneath 'current_block'.  */