summaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.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/ipa-utils.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/ipa-utils.c')
-rw-r--r--gcc/ipa-utils.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c
index 91fc3806a2e..ba15e36b5e2 100644
--- a/gcc/ipa-utils.c
+++ b/gcc/ipa-utils.c
@@ -237,14 +237,14 @@ ipa_free_postorder_info (void)
/* Get the set of nodes for the cycle in the reduced call graph starting
from NODE. */
-VEC (cgraph_node_p, heap) *
+vec<cgraph_node_ptr>
ipa_get_nodes_in_cycle (struct cgraph_node *node)
{
- VEC (cgraph_node_p, heap) *v = NULL;
+ vec<cgraph_node_ptr> v = vNULL;
struct ipa_dfs_info *node_dfs_info;
while (node)
{
- VEC_safe_push (cgraph_node_p, heap, v, node);
+ v.safe_push (node);
node_dfs_info = (struct ipa_dfs_info *) node->symbol.aux;
node = node_dfs_info->next_cycle;
}
@@ -371,7 +371,7 @@ cgraph_node_set_new (void)
new_node_set = XCNEW (struct cgraph_node_set_def);
new_node_set->map = pointer_map_create ();
- new_node_set->nodes = NULL;
+ new_node_set->nodes.create (0);
return new_node_set;
}
@@ -388,15 +388,15 @@ cgraph_node_set_add (cgraph_node_set set, struct cgraph_node *node)
if (*slot)
{
int index = (size_t) *slot - 1;
- gcc_checking_assert ((VEC_index (cgraph_node_ptr, set->nodes, index)
+ gcc_checking_assert ((set->nodes[index]
== node));
return;
}
- *slot = (void *)(size_t) (VEC_length (cgraph_node_ptr, set->nodes) + 1);
+ *slot = (void *)(size_t) (set->nodes.length () + 1);
/* Insert into node vector. */
- VEC_safe_push (cgraph_node_ptr, heap, set->nodes, node);
+ set->nodes.safe_push (node);
}
@@ -414,12 +414,12 @@ cgraph_node_set_remove (cgraph_node_set set, struct cgraph_node *node)
return;
index = (size_t) *slot - 1;
- gcc_checking_assert (VEC_index (cgraph_node_ptr, set->nodes, index)
+ gcc_checking_assert (set->nodes[index]
== node);
/* Remove from vector. We do this by swapping node with the last element
of the vector. */
- last_node = VEC_pop (cgraph_node_ptr, set->nodes);
+ last_node = set->nodes.pop ();
if (last_node != node)
{
last_slot = pointer_map_contains (set->map, last_node);
@@ -427,7 +427,7 @@ cgraph_node_set_remove (cgraph_node_set set, struct cgraph_node *node)
*last_slot = (void *)(size_t) (index + 1);
/* Move the last element to the original spot of NODE. */
- VEC_replace (cgraph_node_ptr, set->nodes, index, last_node);
+ set->nodes[index] = last_node;
}
/* Remove element from hash table. */
@@ -485,7 +485,7 @@ debug_cgraph_node_set (cgraph_node_set set)
void
free_cgraph_node_set (cgraph_node_set set)
{
- VEC_free (cgraph_node_ptr, heap, set->nodes);
+ set->nodes.release ();
pointer_map_destroy (set->map);
free (set);
}
@@ -500,7 +500,7 @@ varpool_node_set_new (void)
new_node_set = XCNEW (struct varpool_node_set_def);
new_node_set->map = pointer_map_create ();
- new_node_set->nodes = NULL;
+ new_node_set->nodes.create (0);
return new_node_set;
}
@@ -517,15 +517,15 @@ varpool_node_set_add (varpool_node_set set, struct varpool_node *node)
if (*slot)
{
int index = (size_t) *slot - 1;
- gcc_checking_assert ((VEC_index (varpool_node_ptr, set->nodes, index)
+ gcc_checking_assert ((set->nodes[index]
== node));
return;
}
- *slot = (void *)(size_t) (VEC_length (varpool_node_ptr, set->nodes) + 1);
+ *slot = (void *)(size_t) (set->nodes.length () + 1);
/* Insert into node vector. */
- VEC_safe_push (varpool_node_ptr, heap, set->nodes, node);
+ set->nodes.safe_push (node);
}
@@ -543,12 +543,12 @@ varpool_node_set_remove (varpool_node_set set, struct varpool_node *node)
return;
index = (size_t) *slot - 1;
- gcc_checking_assert (VEC_index (varpool_node_ptr, set->nodes, index)
+ gcc_checking_assert (set->nodes[index]
== node);
/* Remove from vector. We do this by swapping node with the last element
of the vector. */
- last_node = VEC_pop (varpool_node_ptr, set->nodes);
+ last_node = set->nodes.pop ();
if (last_node != node)
{
last_slot = pointer_map_contains (set->map, last_node);
@@ -556,7 +556,7 @@ varpool_node_set_remove (varpool_node_set set, struct varpool_node *node)
*last_slot = (void *)(size_t) (index + 1);
/* Move the last element to the original spot of NODE. */
- VEC_replace (varpool_node_ptr, set->nodes, index, last_node);
+ set->nodes[index] = last_node;
}
/* Remove element from hash table. */
@@ -605,7 +605,7 @@ dump_varpool_node_set (FILE *f, varpool_node_set set)
void
free_varpool_node_set (varpool_node_set set)
{
- VEC_free (varpool_node_ptr, heap, set->nodes);
+ set->nodes.release ();
pointer_map_destroy (set->map);
free (set);
}