Really avoid constructing two struct types for the same struct in FIRM.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 20 Dec 2007 06:19:13 +0000 (06:19 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 20 Dec 2007 06:19:13 +0000 (06:19 +0000)
[r18811]

ast2firm.c

index 1b9cf5c..27e502f 100644 (file)
@@ -556,7 +556,8 @@ static ir_type *create_struct_type(compound_type_t *type)
        dbg_info *dbgi  = get_dbg_info(&type->type.source_position);
        ir_type *irtype = new_d_type_struct(id, dbgi);
 
-       type->type.firm_type = irtype;
+       declaration->v.irtype = irtype;
+       type->type.firm_type  = irtype;
 
        size_t align_all  = 1;
        size_t offset     = 0;
@@ -646,8 +647,6 @@ static ir_type *create_struct_type(compound_type_t *type)
        set_type_size_bytes(irtype, offset);
        set_type_state(irtype, layout_fixed);
 
-       declaration->v.irtype = irtype;
-
        return irtype;
 }