aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2005-05-14 13:05:37 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2005-05-14 13:05:37 +0000
commit7af893cb9f5d6cd81a29535b029ac25879768f17 (patch)
tree5a4b25091b14d0f08d5820d647e43a951ffd12e2
parent03b0db0a4e53f8ebbfa884f7791f7afb95e879f3 (diff)
downloadgcc-7af893cb9f5d6cd81a29535b029ac25879768f17.zip
gcc-7af893cb9f5d6cd81a29535b029ac25879768f17.tar.gz
gcc-7af893cb9f5d6cd81a29535b029ac25879768f17.tar.bz2
tree-ssa-live.c (tpa_init, [...]): Use VEC instead of VARRAY.
* 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. From-SVN: r99695
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/tree-ssa-live.c18
-rw-r--r--gcc/tree-ssa-live.h4
3 files changed, 20 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 365ac33..af16478 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 73c46a2..f40df90 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -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
diff --git a/gcc/tree-ssa-live.h b/gcc/tree-ssa-live.h
index c302949..050d083 100644
--- a/gcc/tree-ssa-live.h
+++ b/gcc/tree-ssa-live.h
@@ -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);
}