Commit 49938636 authored by Andreas Zwinkau's avatar Andreas Zwinkau
Browse files

reuse is_switch_Cond function

parent 27fe9e1e
......@@ -77,6 +77,11 @@ static bool is_Block_removable(ir_node *block)
return get_Block_mark(block);
}
static bool is_switch_Cond(ir_node *cond) {
ir_node *sel = get_Cond_selector(cond);
return get_irn_mode(sel) != mode_b;
}
static void clear_link(ir_node *node, void *ctx)
{
(void) ctx;
......@@ -114,14 +119,11 @@ static void collect_nodes(ir_node *n, void *ctx)
ir_node *pred = get_Proj_pred(n);
set_irn_link(n, get_irn_link(pred));
set_irn_link(pred, n);
} else if (is_Cond(n)) {
ir_node *sel = get_Cond_selector(n);
if (get_irn_mode(sel) != mode_b) {
} else if (is_Cond(n) && is_switch_Cond(n)) {
/* found a switch-Cond, collect */
ARR_APP1(ir_node*, env->switch_conds, n);
}
}
}
}
/** Returns true if pred is predecessor of block. */
......@@ -536,10 +538,6 @@ static bool handle_switch_cond(ir_node *cond)
return false;
}
static bool is_switch_Cond(ir_node *cond) {
return get_irn_mode(get_Cond_selector(cond)) != mode_b;
}
static bool get_phase_flag(ir_phase *block_info, ir_node *block, int offset) {
return ((int)phase_get_irn_data(block_info, block)) & (1<<offset);
}
......
Supports Markdown
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