static void switch_statement_to_firm(switch_statement_t *statement)
{
- ir_node *first_block = get_cur_block();
+ ir_node *first_block = NULL;
dbg_info *dbgi = get_dbg_info(&statement->base.source_position);
ir_node *cond = NULL;
- if (first_block != NULL) {
+
+ if (get_cur_block() != NULL) {
ir_node *expression = expression_to_firm(statement->expression);
cond = new_d_Cond(dbgi, expression);
+ first_block = get_cur_block();
}
set_cur_block(NULL);
if (entity->function.need_closure) {
/* add an extra parameter for the static link */
- entity->function.static_link = new_r_Proj(irg, start_block, args, mode_P_data, 0);
+ entity->function.static_link = new_r_Proj(start_block, args, mode_P_data, 0);
++first_param_nr;
}
ir_mode *param_mode = get_type_mode(param_irtype);
long pn = n + first_param_nr;
- ir_node *value = new_r_Proj(irg, start_block, args, param_mode, pn);
+ ir_node *value = new_r_Proj(start_block, args, param_mode, pn);
ir_mode *mode = get_ir_mode_storage(type);
value = create_conv(NULL, value, mode);