summaryrefslogtreecommitdiff
path: root/gcc/dwarf2cfi.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2018-05-01 19:16:43 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-05-01 19:16:43 +0000
commitb94c2dc138c60636e3898b04c1026cbb1b868b26 (patch)
treee99c38252e340bc2e91a93e586b47cdf8ba5aaf3 /gcc/dwarf2cfi.c
parent2cc7d3a7da20bcfd854302b1f265c6551b8a3741 (diff)
Add VEC_ORDERED_REMOVE_IF
2018-05-01 Tom de Vries <tom@codesourcery.com> PR other/83786 * vec.h (VEC_ORDERED_REMOVE_IF, VEC_ORDERED_REMOVE_IF_FROM_TO): Define. * vec.c (test_ordered_remove_if): New function. (vec_c_tests): Call test_ordered_remove_if. * dwarf2cfi.c (connect_traces): Use VEC_ORDERED_REMOVE_IF_FROM_TO. * lto-streamer-out.c (prune_offload_funcs): Use VEC_ORDERED_REMOVE_IF. * tree-vect-patterns.c (vect_pattern_recog_1): Use VEC_ORDERED_REMOVE_IF. From-SVN: r259808
Diffstat (limited to 'gcc/dwarf2cfi.c')
-rw-r--r--gcc/dwarf2cfi.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index 07e6a5a2887..4cfb91b8d40 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -2719,7 +2719,7 @@ before_next_cfi_note (rtx_insn *start)
static void
connect_traces (void)
{
- unsigned i, n = trace_info.length ();
+ unsigned i, n;
dw_trace_info *prev_ti, *ti;
/* ??? Ideally, we should have both queued and processed every trace.
@@ -2730,20 +2730,15 @@ connect_traces (void)
these are not "real" instructions, and should not be considered.
This could be generically useful for tablejump data as well. */
/* Remove all unprocessed traces from the list. */
- for (i = n - 1; i > 0; --i)
- {
- ti = &trace_info[i];
- if (ti->beg_row == NULL)
- {
- trace_info.ordered_remove (i);
- n -= 1;
- }
- else
- gcc_assert (ti->end_row != NULL);
- }
+ unsigned ix, ix2;
+ VEC_ORDERED_REMOVE_IF_FROM_TO (trace_info, ix, ix2, ti, 1,
+ trace_info.length (), ti->beg_row == NULL);
+ FOR_EACH_VEC_ELT (trace_info, ix, ti)
+ gcc_assert (ti->end_row != NULL);
/* Work from the end back to the beginning. This lets us easily insert
remember/restore_state notes in the correct order wrt other notes. */
+ n = trace_info.length ();
prev_ti = &trace_info[n - 1];
for (i = n - 1; i > 0; --i)
{