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) ...@@ -77,6 +77,11 @@ static bool is_Block_removable(ir_node *block)
return get_Block_mark(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) static void clear_link(ir_node *node, void *ctx)
{ {
(void) ctx; (void) ctx;
...@@ -114,12 +119,9 @@ static void collect_nodes(ir_node *n, void *ctx) ...@@ -114,12 +119,9 @@ static void collect_nodes(ir_node *n, void *ctx)
ir_node *pred = get_Proj_pred(n); ir_node *pred = get_Proj_pred(n);
set_irn_link(n, get_irn_link(pred)); set_irn_link(n, get_irn_link(pred));
set_irn_link(pred, n); set_irn_link(pred, n);
} else if (is_Cond(n)) { } else if (is_Cond(n) && is_switch_Cond(n)) {
ir_node *sel = get_Cond_selector(n); /* found a switch-Cond, collect */
if (get_irn_mode(sel) != mode_b) { ARR_APP1(ir_node*, env->switch_conds, n);
/* found a switch-Cond, collect */
ARR_APP1(ir_node*, env->switch_conds, n);
}
} }
} }
} }
...@@ -536,10 +538,6 @@ static bool handle_switch_cond(ir_node *cond) ...@@ -536,10 +538,6 @@ static bool handle_switch_cond(ir_node *cond)
return false; 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) { 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); 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