Commit 8572a6c5 authored by sebastian.buchwald1's avatar sebastian.buchwald1
Browse files

Use appropriate macros for iterating over out edges

parent a8583be0
......@@ -99,6 +99,11 @@ FIRM_API const ir_edge_t *get_irn_out_edge_next(const ir_node *irn,
*/
#define foreach_block_succ(bl, edge) foreach_out_edge_kind(bl, edge, EDGE_KIND_BLOCK)
/**
* A convenience iteration macro for all control flow edges.
*/
#define foreach_block_succ_safe(bl, edge) foreach_out_edge_kind_safe(bl, edge, EDGE_KIND_BLOCK)
/**
* Returns the source node of an edge.
* @param edge The edge.
......
......@@ -78,7 +78,7 @@ static void process_stack_bias(sp_sim_func const sim, ir_node *const block,
}
/* Continue at our control flow successors. */
foreach_out_edge_kind(block, edge, EDGE_KIND_BLOCK) {
foreach_block_succ(block, edge) {
ir_node *succ = get_edge_src_irn(edge);
process_stack_bias(sim, succ, p2align, misalign,
state.offset, state.align_padding);
......
......@@ -351,7 +351,7 @@ void edges_notify_edge(ir_node *src, int pos, ir_node *tgt, ir_node *old_tgt,
} else if (get_irn_mode(src) == mode_X && old_tgt != NULL && pos == -1) {
assert(is_Block(old_tgt));
/* moving a jump node from one block to another */
foreach_out_edge_kind_safe(old_tgt, edge, EDGE_KIND_BLOCK) {
foreach_block_succ_safe(old_tgt, edge) {
ir_node *succ = get_edge_src_irn(edge);
int succ_pos = get_edge_src_pos(edge);
ir_node *block_pred = get_Block_cfgpred(succ, succ_pos);
......@@ -831,7 +831,7 @@ static void irg_walk_edges2(ir_node *node, irg_walk_func *pre,
if (pre != NULL)
pre(node, env);
foreach_out_edge_kind_safe(node, edge, EDGE_KIND_NORMAL) {
foreach_out_edge_safe(node, edge) {
/* find the corresponding successor block. */
ir_node *pred = get_edge_src_irn(edge);
assert(pred != NULL && "edge deleted while iterating?");
......@@ -867,7 +867,7 @@ static void irg_block_edges_walk2(ir_node *bl, irg_walk_func *pre,
if (pre)
pre(bl, env);
foreach_out_edge_kind_safe(bl, edge, EDGE_KIND_BLOCK) {
foreach_block_succ_safe(bl, edge) {
/* find the corresponding successor block. */
ir_node *pred = get_edge_src_irn(edge);
irg_block_edges_walk2(pred, pre, post, env);
......
......@@ -263,7 +263,7 @@ count:
unsigned outs_n = 0;
/* Count innerloop branches */
foreach_out_edge_kind(node, edge, EDGE_KIND_BLOCK) {
foreach_block_succ(node, edge) {
ir_node *succ = get_edge_src_irn(edge);
if (is_Block(succ) && is_in_loop(succ))
++outs_n;
......@@ -817,7 +817,7 @@ static void find_condition_chain(ir_node *const block)
/* Get node count */
unsigned nodes_n = 0;
foreach_out_edge_kind(block, edge, EDGE_KIND_NORMAL) {
foreach_out_edge(block, edge) {
++nodes_n;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment