comparison 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
comparison
equal deleted inserted replaced
757:2c730d530c98 758:f04dde6e882c
142 142
143 // debug info 143 // debug info
144 if (global.params.symdebug) { 144 if (global.params.symdebug) {
145 RegisterDwarfSymbols(ir.module); 145 RegisterDwarfSymbols(ir.module);
146 DtoDwarfCompileUnit(this); 146 DtoDwarfCompileUnit(this);
147 }
148
149 // handle invalid 'objectø module
150 if (!ClassDeclaration::object) {
151 error("is missing 'class Object'");
152 fatal();
153 }
154 if (!ClassDeclaration::classinfo) {
155 error("is missing 'class ClassInfo'");
156 fatal();
147 } 157 }
148 158
149 // start out by providing opaque for the built-in class types 159 // start out by providing opaque for the built-in class types
150 if (!ClassDeclaration::object->type->ir.type) 160 if (!ClassDeclaration::object->type->ir.type)
151 ClassDeclaration::object->type->ir.type = new llvm::PATypeHolder(llvm::OpaqueType::get()); 161 ClassDeclaration::object->type->ir.type = new llvm::PATypeHolder(llvm::OpaqueType::get());
991 else 1001 else
992 gIR->constInitList.push_back(this); 1002 gIR->constInitList.push_back(this);
993 } 1003 }
994 else 1004 else
995 { 1005 {
996 assert(ir.irField != 0); 1006 #if DMDV2
1007 if (!ir.irField)
1008 {
1009 printf("dataseg: %d\n", isDataseg());
1010 printf("parent: %s %s\n", parent->kind(), parent->toPrettyChars());
1011 printf("this: %s %s\n", this->kind(), this->toPrettyChars());
1012 }
1013 #endif
1014 // assert(ir.irField != 0);
997 } 1015 }
998 Logger::println("VarDeclaration::toObjFile is done"); 1016 Logger::println("VarDeclaration::toObjFile is done");
999 } 1017 }
1000 1018
1001 /* ================================================================== */ 1019 /* ================================================================== */