diff ir/irtypestruct.cpp @ 1309:0c03ba6f7c24

Fixed deal breaker bug for more-at-once compilation when any module contained aggregates. Fixes ticket #272 .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Thu, 07 May 2009 02:10:29 +0200
parents 8fb39f7f1a7c
children 8d501abecd24
line wrap: on
line diff
--- a/ir/irtypestruct.cpp	Wed May 06 20:29:27 2009 +0200
+++ b/ir/irtypestruct.cpp	Thu May 07 02:10:29 2009 +0200
@@ -208,14 +208,8 @@
         // advance offset to right past this field
         offset = vd->offset + vd->type->size();
 
-        // create ir field
-        if (vd->ir.irField == NULL)
-            new IrField(vd, field_index);
-        else
-            assert(vd->ir.irField->index == field_index &&
-                vd->ir.irField->unionOffset == 0 &&
-                "inconsistent field data");
-        field_index++;
+        // set the field index
+        vd->aggrIndex = (unsigned)field_index++;
     }
 
     // tail padding?
@@ -224,15 +218,6 @@
         add_zeros(defaultTypes, sd->structsize - offset);
     }
 
-    // make sure all fields really get their ir field
-    ArrayIter<VarDeclaration> it(sd->fields);
-    for (; !it.done(); it.next())
-    {
-        VarDeclaration* vd = it.get();
-        if (vd->ir.irField == NULL)
-            new IrField(vd, 0, vd->offset);
-    }
-
     // build the llvm type
     const llvm::Type* st = llvm::StructType::get(defaultTypes, packed);