#ifdef DEBUG_libfirm
assert(bl->out_valid);
#endif /* defined DEBUG_libfirm */
- for (i = 1; i <= PTR_TO_INT(bl->out[0]); ++i) {
- ir_node *succ = bl->out[i];
+ for (i = 1; i <= PTR_TO_INT(bl->out[0]); ++i) {
+ ir_node *succ = bl->out[i];
if (get_irn_mode(succ) == mode_X && get_irn_op(succ) != op_End)
n_cfg_outs += PTR_TO_INT(succ->out[0]);
- }
+ }
return n_cfg_outs;
}
#ifdef DEBUG_libfirm
assert(bl->out_valid);
#endif /* defined DEBUG_libfirm */
- for (i = 1; i <= PTR_TO_INT(bl->out[0]); ++i) {
- ir_node *succ = bl->out[i];
+ for (i = 1; i <= PTR_TO_INT(bl->out[0]); ++i) {
+ ir_node *succ = bl->out[i];
if (get_irn_mode(succ) == mode_X) {
- /* ignore End if we are in the Endblock */
- if (get_irn_op(succ) == op_End &&
- get_irn_n(succ, -1) == bl)
- continue;
- else
+
+ if (get_irn_op(succ) == op_End) {
+ /* ignore End if we are in the Endblock */
+ if (get_irn_n(succ, -1) == bl)
+ continue;
+ else /* count Keep-alive as one */
+ n_cfg_outs += 1;
+ } else
n_cfg_outs += PTR_TO_INT(succ->out[0]);
}
- }
+ }
return n_cfg_outs;
}
#ifdef DEBUG_libfirm
assert (bl->out_valid);
#endif /* defined DEBUG_libfirm */
- for (i = 1; i <= PTR_TO_INT(bl->out[0]); ++i) {
- ir_node *succ = bl->out[i];
- if (get_irn_mode(succ) == mode_X && get_irn_op(succ) != op_End) {
- int n_outs = PTR_TO_INT(succ->out[0]);
+ for (i = 1; i <= PTR_TO_INT(bl->out[0]); ++i) {
+ ir_node *succ = bl->out[i];
+ if (get_irn_mode(succ) == mode_X && get_irn_op(succ) != op_End) {
+ int n_outs = PTR_TO_INT(succ->out[0]);
if (pos < n_outs)
return succ->out[pos + 1];
else
pos -= n_outs;
}
- }
+ }
return NULL;
}
#ifdef DEBUG_libfirm
assert (bl->out_valid);
#endif /* defined DEBUG_libfirm */
- for (i = 1; i <= PTR_TO_INT(bl->out[0]); ++i) {
+ for (i = 1; i <= PTR_TO_INT(bl->out[0]); ++i) {
ir_node *succ = bl->out[i];
- if (get_irn_mode(succ) == mode_X) {
- /* ignore End if we are in the Endblock */
- if (get_irn_op(succ) == op_End && get_irn_n(succ, -1) == bl)
- continue;
- n_outs = PTR_TO_INT(succ->out[0]);
- if (pos < n_outs) {
- /* handle keep-alive here: return the Endblock instead of the End node */
- if (get_irn_op(succ) == op_End)
+ if (get_irn_mode(succ) == mode_X) {
+ if (get_irn_op(succ) == op_End) {
+ if (get_irn_n(succ, -1) == bl) {
+ /* ignore End if we are in the Endblock */
+ continue;
+ }
+ if (pos == 0) {
+ /* handle keep-alive here: return the Endblock instead of the End node */
return get_irn_n(succ, -1);
- return succ->out[pos + 1];
- } else
- pos -= n_outs;
+ } else
+ --pos;
+ } else {
+ n_outs = PTR_TO_INT(succ->out[0]);
+ if (pos < n_outs)
+ return succ->out[pos + 1];
+ else
+ pos -= n_outs;
+ }
}
- }
+ }
return NULL;
}
inc_irg_block_visited(current_ir_graph);
- if (get_irn_mode(node) == mode_X) {
- int i, n;
-
- for (i = 0, n = get_irn_n_outs(node); i < n; ++i) {
- ir_node *succ = get_irn_out(node, i);
- if (get_irn_visited(succ) < get_irg_visited(current_ir_graph))
- irg_out_walk_2(succ, pre, post, env);
- }
- }
- else {
- irg_out_block_walk2(node, pre, post, env);
- }
+ if (get_irn_mode(node) == mode_X) {
+ int i, n;
+
+ for (i = 0, n = get_irn_n_outs(node); i < n; ++i) {
+ ir_node *succ = get_irn_out(node, i);
+ if (get_irn_visited(succ) < get_irg_visited(current_ir_graph))
+ irg_out_walk_2(succ, pre, post, env);
+ }
+ }
+ else {
+ irg_out_block_walk2(node, pre, post, env);
+ }
}
/*--------------------------------------------------------------------*/