gimple_stmt_iterator
gsi_for_stmt (gimple *stmt, gimple_seq *seq)
{
- gimple_stmt_iterator i = gsi_start_1 (seq);
+ gimple_stmt_iterator i = gsi_start (*seq);
i.ptr = stmt;
return i;
}
{
gimple_seq *pseq = phi_nodes_ptr (bb);
- /* Adapted from gsi_start_1. */
+ /* Adapted from gsi_start. */
gphi_iterator i;
i.ptr = gimple_seq_first (*pseq);
/* Return a new iterator pointing to GIMPLE_SEQ's first statement. */
static inline gimple_stmt_iterator
-gsi_start_1 (gimple_seq *seq)
+gsi_start (gimple_seq &seq)
{
gimple_stmt_iterator i;
- i.ptr = gimple_seq_first (*seq);
- i.seq = seq;
+ i.ptr = gimple_seq_first (seq);
+ i.seq = &seq;
i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
return i;
}
-#define gsi_start(x) gsi_start_1 (&(x))
-
static inline gimple_stmt_iterator
gsi_none (void)
{
/* Return a new iterator initially pointing to GIMPLE_SEQ's last statement. */
static inline gimple_stmt_iterator
-gsi_last_1 (gimple_seq *seq)
+gsi_last (gimple_seq &seq)
{
gimple_stmt_iterator i;
- i.ptr = gimple_seq_last (*seq);
- i.seq = seq;
+ i.ptr = gimple_seq_last (seq);
+ i.seq = &seq;
i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
return i;
}
-#define gsi_last(x) gsi_last_1 (&(x))
-
/* Return a new iterator pointing to the last statement in basic block BB. */
static inline gimple_stmt_iterator
return gsi;
}
+/* Return a statement iterator that points to the first
+ non-label statement in sequence SEQ. */
+
+static inline gimple_stmt_iterator
+gsi_after_labels (gimple_seq &seq)
+{
+ gimple_stmt_iterator gsi = gsi_start (seq);
+
+ for (; !gsi_end_p (gsi); )
+ {
+ if (gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
+ gsi_next (&gsi);
+ else
+ break;
+ }
+
+ return gsi;
+}
+
/* Advance the iterator to the next non-debug gimple statement. */
static inline void
x = lang_hooks.decls.omp_clause_copy_ctor (c, iv, x);
gimplify_and_add (x, ilist);
gimple_stmt_iterator gsi
- = gsi_start_1 (gimple_omp_body_ptr (ctx->stmt));
+ = gsi_start (*gimple_omp_body_ptr (ctx->stmt));
gassign *g
= gimple_build_assign (unshare_expr (lvar), iv);
gsi_insert_before_without_update (&gsi, g,
uid, integer_zero_node,
nonconst_simd_if);
gimple_call_set_lhs (g, sctx.lane);
- gimple_stmt_iterator gsi = gsi_start_1 (gimple_omp_body_ptr (ctx->stmt));
+ gimple_stmt_iterator gsi = gsi_start (*gimple_omp_body_ptr (ctx->stmt));
gsi_insert_before_without_update (&gsi, g, GSI_SAME_STMT);
g = gimple_build_assign (sctx.lane, INTEGER_CST,
build_int_cst (unsigned_type_node, 0));
lower_omp (gimple_omp_body_ptr (stmt), octx);
if (before)
{
- gimple_stmt_iterator gsi = gsi_start_1 (gimple_omp_body_ptr (stmt));
+ gimple_stmt_iterator gsi = gsi_start (*gimple_omp_body_ptr (stmt));
gsi_insert_seq_before (&gsi, before, GSI_SAME_STMT);
}
}