Commit d3a434d2 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Assert that [gs]et_{,r_}cur_block() are only called in phase_building.

parent a93219d7
...@@ -527,6 +527,7 @@ void set_cur_block(ir_node *target) ...@@ -527,6 +527,7 @@ void set_cur_block(ir_node *target)
void set_r_cur_block(ir_graph *irg, ir_node *target) void set_r_cur_block(ir_graph *irg, ir_node *target)
{ {
assert(get_irg_phase_state(irg) == phase_building);
assert(target == NULL || get_irn_mode(target) == mode_BB); assert(target == NULL || get_irn_mode(target) == mode_BB);
assert(target == NULL || get_irn_irg(target) == irg); assert(target == NULL || get_irn_irg(target) == irg);
irg->current_block = target; irg->current_block = target;
...@@ -534,6 +535,7 @@ void set_r_cur_block(ir_graph *irg, ir_node *target) ...@@ -534,6 +535,7 @@ void set_r_cur_block(ir_graph *irg, ir_node *target)
ir_node *get_r_cur_block(ir_graph *irg) ir_node *get_r_cur_block(ir_graph *irg)
{ {
assert(get_irg_phase_state(irg) == phase_building);
return irg->current_block; return irg->current_block;
} }
......
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