* tree-ssa-live.c (tpa_init, tpa_delete, tpa_compact,
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 14 May 2005 13:05:37 +0000 (13:05 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 14 May 2005 13:05:37 +0000 (13:05 +0000)
root_var_init, type_var_init): Use VEC instead of VARRAY.
* tree-ssa-live.h (tree_partition_associator_d): Change the
type of trees to VEC(tree,heap)*.
(tpa_tree): Use VEC instead of VARRAY.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99695 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-live.c
gcc/tree-ssa-live.h

index 365ac33..af16478 100644 (file)
@@ -1,3 +1,11 @@
+2005-05-14  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * tree-ssa-live.c (tpa_init, tpa_delete, tpa_compact,
+       root_var_init, type_var_init): Use VEC instead of VARRAY.
+       * tree-ssa-live.h (tree_partition_associator_d): Change the
+       type of trees to VEC(tree,heap)*.
+       (tpa_tree): Use VEC instead of VARRAY.
+
 2005-05-14  Richard Guenther  <rguenth@gcc.gnu.org>
 
        * fold-const.c (div_if_zero_remainder): New function.
index 73c46a2..f40df90 100644 (file)
@@ -795,7 +795,7 @@ tpa_init (var_map map)
   memset (tpa->partition_to_tree_map, TPA_NONE, num_partitions * sizeof (int));
 
   x = MAX (40, (num_partitions / 20));
-  VARRAY_TREE_INIT (tpa->trees, x, "trees");
+  tpa->trees = VEC_alloc (tree, heap, x);
   VARRAY_INT_INIT (tpa->first_partition, x, "first_partition");
 
   return tpa;
@@ -837,6 +837,7 @@ tpa_delete (tpa_p tpa)
   if (!tpa)
     return;
 
+  VEC_free (tree, heap, tpa->trees);
   free (tpa->partition_to_tree_map);
   free (tpa->next_partition);
   free (tpa);
@@ -870,19 +871,20 @@ tpa_compact (tpa_p tpa)
         of the tree list.  */
       if (tpa_next_partition (tpa, first) == NO_PARTITION)
         {
-         swap_t = VARRAY_TREE (tpa->trees, last);
+         swap_t = VEC_index (tree, tpa->trees, last);
          swap_i = VARRAY_INT (tpa->first_partition, last);
 
          /* Update the last entry. Since it is known to only have one
             partition, there is nothing else to update.  */
-         VARRAY_TREE (tpa->trees, last) = VARRAY_TREE (tpa->trees, x);
+         VEC_replace (tree, tpa->trees, last,
+                      VEC_index (tree, tpa->trees, x));
          VARRAY_INT (tpa->first_partition, last) 
            = VARRAY_INT (tpa->first_partition, x);
          tpa->partition_to_tree_map[tpa_first_partition (tpa, last)] = last;
 
          /* Since this list is known to have more than one partition, update
             the list owner entries.  */
-         VARRAY_TREE (tpa->trees, x) = swap_t;
+         VEC_replace (tree, tpa->trees, x, swap_t);
          VARRAY_INT (tpa->first_partition, x) = swap_i;
          for (y = tpa_first_partition (tpa, x); 
               y != NO_PARTITION; 
@@ -961,7 +963,7 @@ root_var_init (var_map map)
         {
          ann->root_var_processed = 1;
          VAR_ANN_ROOT_INDEX (ann) = rv->num_trees++;
-         VARRAY_PUSH_TREE (rv->trees, t);
+         VEC_safe_push (tree, heap, rv->trees, t);
          VARRAY_PUSH_INT (rv->first_partition, p);
        }
       rv->partition_to_tree_map[p] = VAR_ANN_ROOT_INDEX (ann);
@@ -970,7 +972,7 @@ root_var_init (var_map map)
   /* Reset the out_of_ssa_tag flag on each variable for later use.  */
   for (x = 0; x < rv->num_trees; x++)
     {
-      t = VARRAY_TREE (rv->trees, x);
+      t = VEC_index (tree, rv->trees, x);
       var_ann (t)->root_var_processed = 0;
     }
 
@@ -1026,12 +1028,12 @@ type_var_init (var_map map)
 
       /* Find the list for this type.  */
       for (y = 0; y < tv->num_trees; y++)
-        if (t == VARRAY_TREE (tv->trees, y))
+        if (t == VEC_index (tree, tv->trees, y))
          break;
       if (y == tv->num_trees)
         {
          tv->num_trees++;
-         VARRAY_PUSH_TREE (tv->trees, t);
+         VEC_safe_push (tree, heap, tv->trees, t);
          VARRAY_PUSH_INT (tv->first_partition, p);
        }
       else
index c302949..050d083 100644 (file)
@@ -337,7 +337,7 @@ make_live_on_entry (tree_live_info_p live, basic_block bb , int p)
 
 typedef struct tree_partition_associator_d
 {
-  varray_type trees;
+  VEC(tree,heap) *trees;
   varray_type first_partition;
   int *next_partition;
   int *partition_to_tree_map;
@@ -375,7 +375,7 @@ tpa_num_trees (tpa_p tpa)
 static inline tree
 tpa_tree (tpa_p tpa, int i)
 {
-  return VARRAY_TREE (tpa->trees, i);
+  return VEC_index (tree, tpa->trees, i);
 }