X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast2firm.c;h=f92f870d99d20e2a4ceec3b9c4599c02a27d8a21;hb=6b26906854c2f5423fa3986a0caf3c23b200b553;hp=394e168df066ffa02220d805c458b0315080a52e;hpb=5cf13875fb1b34c3df5a1cfd4ea7f7a1ceb7ea65;p=cparser diff --git a/ast2firm.c b/ast2firm.c index 394e168..f92f870 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -2524,6 +2524,11 @@ static ir_node *create_cast(dbg_info *dbgi, ir_node *value_node, type_t *from_type, type_t *type) { type = skip_typeref(type); + if (type == type_void) { + /* make sure firm type is constructed */ + (void) get_ir_type(type); + return NULL; + } if (!is_type_scalar(type)) { /* make sure firm type is constructed */ (void) get_ir_type(type); @@ -4923,14 +4928,10 @@ static void if_statement_to_firm(if_statement_t *statement) static void while_statement_to_firm(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(); - if (jmp != NULL) { + if (get_cur_block() != NULL) { + ir_node *const jmp = new_Jmp(); add_immBlock_pred(header_block, jmp); } @@ -4950,7 +4951,7 @@ static void while_statement_to_firm(while_statement_t *statement) break_label = old_break_label; if (get_cur_block() != NULL) { - jmp = new_Jmp(); + ir_node *const jmp = new_Jmp(); add_immBlock_pred(header_block, jmp); }