summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-uncprop.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-27 12:04:21 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-27 12:04:21 +0000
commit58287c3f4b74a0bb479c7036117d5804eb6765c4 (patch)
treec299b554740820453d3def4a8e59007a86edd7c7 /gcc/tree-ssa-uncprop.c
parentdb827453ce1b7f76552f8ba9a8d18e65d7bf8de8 (diff)
downloadgcc-58287c3f4b74a0bb479c7036117d5804eb6765c4.tar.gz
2012-11-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 193836 using svnmerge.py **broken, gcc/melt/xtramelt-ana-base.melt dont compile** git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@193843 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-uncprop.c')
-rw-r--r--gcc/tree-ssa-uncprop.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c
index aeeaa04fee6..1df7d07308c 100644
--- a/gcc/tree-ssa-uncprop.c
+++ b/gcc/tree-ssa-uncprop.c
@@ -264,7 +264,7 @@ associate_equivalences_with_edges (void)
leading to this block. If no such edge equivalency exists, then we
record NULL. These equivalences are live until we leave the dominator
subtree rooted at the block where we record the equivalency. */
-static VEC(tree,heap) *equiv_stack;
+static vec<tree> equiv_stack;
/* Global hash table implementing a mapping from invariant values
to a list of SSA_NAMEs which have the same value. We might be
@@ -278,7 +278,7 @@ struct equiv_hash_elt
tree value;
/* List of SSA_NAMEs which have the same value/key. */
- VEC(tree,heap) *equivalences;
+ vec<tree> equivalences;
};
static void uncprop_enter_block (struct dom_walk_data *, basic_block);
@@ -309,7 +309,7 @@ static void
equiv_free (void *p)
{
struct equiv_hash_elt *elt = (struct equiv_hash_elt *) p;
- VEC_free (tree, heap, elt->equivalences);
+ elt->equivalences.release ();
free (elt);
}
@@ -322,12 +322,12 @@ remove_equivalence (tree value)
void **slot;
equiv_hash_elt.value = value;
- equiv_hash_elt.equivalences = NULL;
+ equiv_hash_elt.equivalences.create (0);
slot = htab_find_slot (equiv, &equiv_hash_elt, NO_INSERT);
equiv_hash_elt_p = (struct equiv_hash_elt *) *slot;
- VEC_pop (tree, equiv_hash_elt_p->equivalences);
+ equiv_hash_elt_p->equivalences.pop ();
}
/* Record EQUIVALENCE = VALUE into our hash table. */
@@ -340,7 +340,7 @@ record_equiv (tree value, tree equivalence)
equiv_hash_elt = XNEW (struct equiv_hash_elt);
equiv_hash_elt->value = value;
- equiv_hash_elt->equivalences = NULL;
+ equiv_hash_elt->equivalences.create (0);
slot = htab_find_slot (equiv, equiv_hash_elt, INSERT);
@@ -351,7 +351,7 @@ record_equiv (tree value, tree equivalence)
equiv_hash_elt = (struct equiv_hash_elt *) *slot;
- VEC_safe_push (tree, heap, equiv_hash_elt->equivalences, equivalence);
+ equiv_hash_elt->equivalences.safe_push (equivalence);
}
/* Main driver for un-cprop. */
@@ -366,7 +366,7 @@ tree_ssa_uncprop (void)
/* Create our global data structures. */
equiv = htab_create (1024, equiv_hash, equiv_eq, equiv_free);
- equiv_stack = VEC_alloc (tree, heap, 2);
+ equiv_stack.create (2);
/* We're going to do a dominator walk, so ensure that we have
dominance information. */
@@ -394,7 +394,7 @@ tree_ssa_uncprop (void)
need to empty elements out of the hash table, free EQUIV_STACK,
and cleanup the AUX field on the edges. */
htab_delete (equiv);
- VEC_free (tree, heap, equiv_stack);
+ equiv_stack.release ();
FOR_EACH_BB (bb)
{
edge e;
@@ -422,7 +422,7 @@ uncprop_leave_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb ATTRIBUTE_UNUSED)
{
/* Pop the topmost value off the equiv stack. */
- tree value = VEC_pop (tree, equiv_stack);
+ tree value = equiv_stack.pop ();
/* If that value was non-null, then pop the topmost equivalency off
its equivalency stack. */
@@ -477,7 +477,7 @@ uncprop_into_successor_phis (basic_block bb)
/* Lookup this argument's value in the hash table. */
equiv_hash_elt.value = arg;
- equiv_hash_elt.equivalences = NULL;
+ equiv_hash_elt.equivalences.create (0);
slot = htab_find_slot (equiv, &equiv_hash_elt, NO_INSERT);
if (slot)
@@ -490,9 +490,9 @@ uncprop_into_successor_phis (basic_block bb)
then replace the value in the argument with its equivalent
SSA_NAME. Use the most recent equivalence as hopefully
that results in shortest lifetimes. */
- for (j = VEC_length (tree, elt->equivalences) - 1; j >= 0; j--)
+ for (j = elt->equivalences.length () - 1; j >= 0; j--)
{
- tree equiv = VEC_index (tree, elt->equivalences, j);
+ tree equiv = elt->equivalences[j];
if (SSA_NAME_VAR (equiv) == SSA_NAME_VAR (res)
&& TREE_TYPE (equiv) == TREE_TYPE (res))
@@ -563,13 +563,13 @@ uncprop_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
struct edge_equivalency *equiv = (struct edge_equivalency *) e->aux;
record_equiv (equiv->rhs, equiv->lhs);
- VEC_safe_push (tree, heap, equiv_stack, equiv->rhs);
+ equiv_stack.safe_push (equiv->rhs);
recorded = true;
}
}
if (!recorded)
- VEC_safe_push (tree, heap, equiv_stack, NULL_TREE);
+ equiv_stack.safe_push (NULL_TREE);
uncprop_into_successor_phis (bb);
}