static void do_while_statement_to_firm(do_while_statement_t *statement)
{
- ir_node *jmp = NULL;
- if (get_cur_block() != NULL) {
- jmp = new_Jmp();
- }
-
/* create the header block */
ir_node *header_block = new_immBlock();
/* the loop body */
ir_node *body_block = new_immBlock();
- if (jmp != NULL) {
- add_immBlock_pred(body_block, jmp);
+ if (get_cur_block() != NULL) {
+ add_immBlock_pred(body_block, new_Jmp());
}
ir_node *old_continue_label = continue_label;
ir_node *const false_block = new_immBlock();
/* the loop body */
- ir_node *body_block;
- if (statement->body != NULL) {
- ir_node *const old_continue_label = continue_label;
- ir_node *const old_break_label = break_label;
- continue_label = step_block;
- break_label = false_block;
-
- body_block = new_immBlock();
- set_cur_block(body_block);
- statement_to_firm(statement->body);
+ ir_node *const old_continue_label = continue_label;
+ ir_node *const old_break_label = break_label;
+ continue_label = step_block;
+ break_label = false_block;
- assert(continue_label == step_block);
- assert(break_label == false_block);
- continue_label = old_continue_label;
- break_label = old_break_label;
+ ir_node *const body_block = new_immBlock();
+ set_cur_block(body_block);
+ statement_to_firm(statement->body);
- if (get_cur_block() != NULL) {
- jmp = new_Jmp();
- add_immBlock_pred(step_block, jmp);
- }
- } else {
- body_block = step_block;
+ assert(continue_label == step_block);
+ assert(break_label == false_block);
+ continue_label = old_continue_label;
+ break_label = old_break_label;
+
+ if (get_cur_block() != NULL) {
+ jmp = new_Jmp();
+ add_immBlock_pred(step_block, jmp);
}
/* create the condition */
set_Cond_default_proj(cond, default_proj_nr);
}
- if (statement->body != NULL) {
- statement_to_firm(statement->body);
- }
+ statement_to_firm(statement->body);
if (get_cur_block() != NULL) {
ir_node *jmp = new_Jmp();
dbg_info *dbgi = get_dbg_info(&statement->base.source_position);
- ir_node *const fallthrough = (get_cur_block() == NULL ? NULL : new_Jmp());
-
ir_node *proj;
ir_node *block = new_immBlock();
+ if (get_cur_block() != NULL) {
+ /* Fallthrough from previous case */
+ add_immBlock_pred(block, new_Jmp());
+ }
+
if (current_switch_cond != NULL) {
set_cur_block(get_nodes_block(current_switch_cond));
if (statement->expression != NULL) {
}
}
- if (fallthrough != NULL) {
- add_immBlock_pred(block, fallthrough);
- }
mature_immBlock(block);
set_cur_block(block);
- if (statement->statement != NULL) {
- statement_to_firm(statement->statement);
- }
+ statement_to_firm(statement->statement);
}
static void label_to_firm(const label_statement_t *statement)
keep_alive(block);
keep_all_memory(block);
- if (statement->statement != NULL) {
- statement_to_firm(statement->statement);
- }
+ statement_to_firm(statement->statement);
}
static void goto_to_firm(const goto_statement_t *statement)