/* Iterator routines for GIMPLE statements.
- Copyright (C) 2007-2017 Free Software Foundation, Inc.
+ Copyright (C) 2007-2019 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldy@quesejoda.com>
This file is part of GCC.
return i;
}
+/* Get an iterator for STMT, which is known to belong to SEQ. This is
+ equivalent to starting at the beginning of SEQ and searching forward
+ until STMT is found. */
+
+gimple_stmt_iterator
+gsi_for_stmt (gimple *stmt, gimple_seq *seq)
+{
+ gimple_stmt_iterator i = gsi_start_1 (seq);
+ i.ptr = stmt;
+ return i;
+}
+
/* Finds iterator for PHI. */
gphi_iterator
if (gsi_end_p (*gsi))
return true;
- /* Make sure we insert after any leading labels. We have to
- skip debug stmts before or among them, though. We didn't
- have to skip debug stmts after the last label, but it
- shouldn't hurt if we do. */
+ /* Make sure we insert after any leading labels. */
tmp = gsi_stmt (*gsi);
- while (gimple_code (tmp) == GIMPLE_LABEL
- || is_gimple_debug (tmp))
+ while (gimple_code (tmp) == GIMPLE_LABEL)
{
gsi_next (gsi);
if (gsi_end_p (*gsi))