diff ir/irtypestruct.cpp @ 1245:465a77c904d4

Fixed all issues preventing Tango 0.99.8 to compile with `sh build-tango.sh --verbose ldc'.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Fri, 17 Apr 2009 14:38:29 +0200
parents 9201e0d41ee5
children ec1d9dc1d32a
line wrap: on
line diff
--- a/ir/irtypestruct.cpp	Fri Apr 17 03:01:43 2009 +0200
+++ b/ir/irtypestruct.cpp	Fri Apr 17 14:38:29 2009 +0200
@@ -86,14 +86,16 @@
     for (; !it.done(); it.next())
     {
         VarDeclaration* vd = it.get();
+        //Logger::println("vd: %s", vd->toPrettyChars());
 
-        assert(vd->ir.irField == NULL && "struct inheritance is not allowed, how can this happen?");
+        //assert(vd->ir.irField == NULL && "struct inheritance is not allowed, how can this happen?");
 
         // skip if offset moved backwards
         if (vd->offset < offset)
         {
             IF_LOG Logger::println("Skipping field %s %s (+%u) for default", vd->type->toChars(), vd->toChars(), vd->offset);
-            new IrField(vd, 0, vd->offset);
+            if (vd->ir.irField == NULL)
+                new IrField(vd, 0, vd->offset);
             continue;
         }
 
@@ -123,7 +125,8 @@
         // the IrField creation doesn't really belong here, but it's a trivial operation
         // and it save yet another of these loops.
         IF_LOG Logger::println("Field index: %zu", field_index);
-        new IrField(vd, field_index);
+        if (vd->ir.irField == NULL)
+            new IrField(vd, field_index);
         field_index++;
     }
 
@@ -142,7 +145,7 @@
     // name types
     Type::sir->getState()->module->addTypeName(sd->toPrettyChars(), pa.get());
 
-#if 1
+#if 0
     IF_LOG Logger::cout() << "final struct type: " << *pa.get() << std::endl;
 #endif