diff gen/toobj.cpp @ 758:f04dde6e882c

Added initial D2 support, D2 frontend and changes to codegen to make things compile.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 11 Nov 2008 01:38:48 +0100
parents dc8b8b7ea0c1
children 9a9f403ab399
line wrap: on
line diff
--- a/gen/toobj.cpp	Mon Nov 10 20:55:24 2008 +0100
+++ b/gen/toobj.cpp	Tue Nov 11 01:38:48 2008 +0100
@@ -146,6 +146,16 @@
         DtoDwarfCompileUnit(this);
     }
 
+    // handle invalid 'objectø module
+    if (!ClassDeclaration::object) {
+        error("is missing 'class Object'");
+        fatal();
+    }
+    if (!ClassDeclaration::classinfo) {
+        error("is missing 'class ClassInfo'");
+        fatal();
+    }
+
     // start out by providing opaque for the built-in class types
     if (!ClassDeclaration::object->type->ir.type)
         ClassDeclaration::object->type->ir.type = new llvm::PATypeHolder(llvm::OpaqueType::get());
@@ -993,7 +1003,15 @@
     }
     else
     {
-        assert(ir.irField != 0);
+    #if DMDV2
+        if (!ir.irField)
+        {
+            printf("dataseg: %d\n", isDataseg());
+            printf("parent: %s %s\n", parent->kind(), parent->toPrettyChars());
+            printf("this: %s %s\n", this->kind(), this->toPrettyChars());
+        }
+    #endif
+//         assert(ir.irField != 0);
     }
     Logger::println("VarDeclaration::toObjFile is done");
 }