This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Implement gsi_after_labels
- From: "Rafael Espindola" <espindola at google dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: "Diego Novillo" <dnovillo at google dot com>
- Date: Wed, 30 Jan 2008 10:17:20 +0000
- Subject: Implement gsi_after_labels
I noticed that bsi_after_labels was removed but no gsi_after_labels
was added. This patch implements it.
2008-01-30 Rafael Espindola <espindola@google.com>
* gcc/gimple.h (gsi_after_labels): add.
Cheers,
--
Rafael Avila de Espindola
Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland
Registered in Dublin, Ireland
Registration Number: 368047
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 73db231..b2260eb 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -2647,6 +2647,16 @@ gsi_stmt (gimple_stmt_iterator *i)
return i->stmt;
}
+static inline gimple_stmt_iterator *
+gsi_after_labels (basic_block bb)
+{
+ gimple_stmt_iterator *gsi = gsi_start_bb (bb);
+
+ while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
+ gsi_next (gsi);
+
+ return gsi;
+}
/* Return a pointer to the current stmt. */