Commit e5eb3be0 authored by Matthias Braun's avatar Matthias Braun
Browse files

make firm optimisations independent of current_ir_graph

[r28036]
parent 95bd6dd6
......@@ -222,20 +222,18 @@ static void move_edges(ir_node *node, ir_node *from_bl, ir_node *to_bl)
void part_block(ir_node *node)
{
ir_node *new_block, *old_block;
ir_node *phi, *jmp;
ir_graph *rem = current_ir_graph;
ir_graph *irg = get_irn_irg(node);
ir_node *new_block, *old_block;
ir_node *phi, *jmp;
/* Turn off optimizations so that blocks are not merged again. */
int rem_opt = get_opt_optimize();
set_optimize(0);
current_ir_graph = get_irn_irg(node);
/* Transform the control flow */
old_block = get_nodes_block(node);
new_block = new_Block(get_Block_n_cfgpreds(old_block),
get_Block_cfgpred_arr(old_block));
new_block = new_r_Block(irg, get_Block_n_cfgpreds(old_block),
get_Block_cfgpred_arr(old_block));
/* create a jump from new_block to old_block, which is now the lower one */
jmp = new_r_Jmp(new_block);
......@@ -254,7 +252,6 @@ void part_block(ir_node *node)
}
set_optimize(rem_opt);
current_ir_graph = rem;
}
ir_node *part_block_edges(ir_node *node)
......
......@@ -342,8 +342,6 @@ ir_graph *new_const_code_irg(void)
set_irn_visited(bad, -1);
set_irn_visited(no_mem, -1);
res->phase_state = phase_high;
return res;
}
......
......@@ -334,6 +334,7 @@ ir_node *new_d_{{node.constrname}}(
{% endfilter %})
{
ir_node *res;
assert(get_irg_phase_state(current_ir_graph) == phase_building);
res = new_rd_{{node.constrname}}(
{%- filter parameters %}
dbgi
......
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