This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.  */
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]