X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast2firm.c;h=f1dc45c249627587767588ec20dea5a2e6537c86;hb=6c0cf065657863296355786c99aac830b85e2d9b;hp=f3f8f20dd2c764b7f79aafd70d4cef7c892542ba;hpb=75054c64100620c5b7ecac17b8fcf6dfe42e8f94;p=cparser diff --git a/ast2firm.c b/ast2firm.c index f3f8f20..f1dc45c 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -530,7 +530,7 @@ static ir_type *create_bitfield_type(bitfield_type_t *const type) assert(base->kind == TYPE_ATOMIC || base->kind == TYPE_ENUM); ir_type *irbase = get_ir_type(base); - unsigned size = fold_constant(type->size); + unsigned size = type->bit_size; assert(!is_type_float(base)); if (is_type_signed(base)) { @@ -650,7 +650,7 @@ static ir_type *create_compound_type(compound_type_t *type, ir_type *irtype, size_t base; size_t bits_remainder; if (entry_type->kind == TYPE_BITFIELD) { - size_t size_bits = fold_constant(entry_type->bitfield.size); + size_t size_bits = entry_type->bitfield.bit_size; size_t rest_size_bits = (entry_alignment - misalign)*8 - bit_offset; if (size_bits > rest_size_bits) { @@ -807,7 +807,9 @@ static ir_type *get_ir_type(type_t *type) ir_type *firm_type = NULL; switch (type->kind) { case TYPE_ERROR: - panic("error type occurred"); + /* Happens while constant folding, when there was an error */ + return create_atomic_type(&type_void->atomic); + case TYPE_ATOMIC: firm_type = create_atomic_type(&type->atomic); break; @@ -2956,7 +2958,7 @@ static ir_node *builtin_prefetch_to_firm( static ir_node *get_label_block(declaration_t *label) { - assert(label->namespc == NAMESPACE_LABEL); + assert(label->namespc == NAMESPACE_LABEL || label->namespc == NAMESPACE_LOCAL_LABEL); if (label->declaration_kind == DECLARATION_KIND_LABEL_BLOCK) { return label->v.block; @@ -4376,12 +4378,13 @@ static void for_statement_to_firm(for_statement_t *statement) for( ; declaration != NULL; declaration = declaration->next) { create_local_declaration(declaration); } - declaration = statement->scope.declarations; - for( ; declaration != NULL; declaration = declaration->next) { - initialize_local_declaration(declaration); - } if (get_cur_block() != NULL) { + declaration = statement->scope.declarations; + for( ; declaration != NULL; declaration = declaration->next) { + initialize_local_declaration(declaration); + } + if (statement->initialisation != NULL) { expression_to_firm(statement->initialisation); } @@ -4572,7 +4575,7 @@ static void switch_statement_to_firm(switch_statement_t *statement) static void case_label_to_firm(const case_label_statement_t *statement) { - if (statement->is_empty) + if (statement->is_empty_range) return; dbg_info *dbgi = get_dbg_info(&statement->base.source_position); @@ -5078,6 +5081,7 @@ static int count_decls_in_expression(const expression_t *expression) { case EXPR_BUILTIN_SYMBOL: case EXPR_VA_START: case EXPR_VA_ARG: + case EXPR_LABEL_ADDRESS: break; }