aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r--gcc/tree-ssa-threadupdate.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index eca88a9..b97be81 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -168,7 +168,7 @@ struct ssa_local_info_t
opportunities as they are discovered. We keep the registered
jump threading opportunities in this vector as edge pairs
(original_edge, target_edge). */
-static VEC(edge,heap) *threaded_edges;
+static vec<edge> threaded_edges;
/* When we start updating the CFG for threading, data necessary for jump
threading is attached to the AUX field for the incoming edge. Use these
@@ -1147,14 +1147,14 @@ mark_threaded_blocks (bitmap threaded_blocks)
edge e;
edge_iterator ei;
- for (i = 0; i < VEC_length (edge, threaded_edges); i += 3)
+ for (i = 0; i < threaded_edges.length (); i += 3)
{
- edge e = VEC_index (edge, threaded_edges, i);
+ edge e = threaded_edges[i];
edge *x = XNEWVEC (edge, 2);
e->aux = x;
- THREAD_TARGET (e) = VEC_index (edge, threaded_edges, i + 1);
- THREAD_TARGET2 (e) = VEC_index (edge, threaded_edges, i + 2);
+ THREAD_TARGET (e) = threaded_edges[i + 1];
+ THREAD_TARGET2 (e) = threaded_edges[i + 2];
bitmap_set_bit (tmp, e->dest->index);
}
@@ -1209,7 +1209,7 @@ thread_through_all_blocks (bool may_peel_loop_headers)
/* We must know about loops in order to preserve them. */
gcc_assert (current_loops != NULL);
- if (threaded_edges == NULL)
+ if (!threaded_edges.exists ())
return false;
threaded_blocks = BITMAP_ALLOC (NULL);
@@ -1248,8 +1248,7 @@ thread_through_all_blocks (bool may_peel_loop_headers)
BITMAP_FREE (threaded_blocks);
threaded_blocks = NULL;
- VEC_free (edge, heap, threaded_edges);
- threaded_edges = NULL;
+ threaded_edges.release ();
if (retval)
loops_state_set (LOOPS_NEED_FIXUP);
@@ -1273,15 +1272,15 @@ register_jump_thread (edge e, edge e2, edge e3)
if (e2 == NULL)
return;
- if (threaded_edges == NULL)
- threaded_edges = VEC_alloc (edge, heap, 15);
+ if (!threaded_edges.exists ())
+ threaded_edges.create (15);
if (dump_file && (dump_flags & TDF_DETAILS)
&& e->dest != e2->src)
fprintf (dump_file,
" Registering jump thread around one or more intermediate blocks\n");
- VEC_safe_push (edge, heap, threaded_edges, e);
- VEC_safe_push (edge, heap, threaded_edges, e2);
- VEC_safe_push (edge, heap, threaded_edges, e3);
+ threaded_edges.safe_push (e);
+ threaded_edges.safe_push (e2);
+ threaded_edges.safe_push (e3);
}