-#define foreach_out_edge(irn,edge) \
- for(edge = get_irn_out_edge_first(irn); edge; edge = get_irn_out_edge_next(irn, edge))
+static INLINE const ir_edge_t *_get_block_succ_first(const ir_node *irn)
+{
+ const struct list_head *head;
+
+ assert(is_Block(irn) && "Node must be a block here");
+ head = _get_block_succ_head(irn);
+ return (ir_edge_t *) (list_empty(head) ? NULL :
+ list_entry(head->next, ir_block_edge_t, succ_list));
+}
+
+/**
+ * Get the next block successor edge.
+ * @see See _get_block_succ_first() for details.
+ * @param irn The block.
+ * @param last The last edge.
+ * @return The next edge, or NULL if there is no further.
+ */
+static INLINE const ir_edge_t *_get_block_succ_next(const ir_node *irn, const ir_edge_t *last)
+{
+ const ir_block_edge_t *block_edge;
+ struct list_head *next;
+
+ assert(is_Block(irn) && "Node must be a block here");
+ block_edge = (const ir_block_edge_t *) last;
+ next = block_edge->succ_list.next;
+ return (ir_edge_t *) (next == _get_block_succ_head(irn) ? NULL :
+ list_entry(next, ir_block_edge_t, succ_list));
+}