diff gen/typinf.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 79758fd2f48a
children 450897f5aae9
line wrap: on
line diff
--- a/gen/typinf.cpp	Fri Apr 17 03:01:43 2009 +0200
+++ b/gen/typinf.cpp	Fri Apr 17 14:38:29 2009 +0200
@@ -638,6 +638,7 @@
     Logger::println("TypeInfoStructDeclaration::llvmDefine() %s", toChars());
     LOG_SCOPE;
 
+    // make sure struct is resolved
     assert(tinfo->ty == Tstruct);
     TypeStruct *tc = (TypeStruct *)tinfo;
     StructDeclaration *sd = tc->sym;
@@ -835,6 +836,11 @@
     Logger::println("TypeInfoClassDeclaration::llvmDefine() %s", toChars());
     LOG_SCOPE;
 
+    // make sure class is resolved
+    assert(tinfo->ty == Tclass);
+    TypeClass *tc = (TypeClass *)tinfo;
+    tc->sym->codegen(Type::sir);
+
     // init typeinfo class
     ClassDeclaration* base = Type::typeinfoclass;
     assert(base);
@@ -849,11 +855,6 @@
     sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
 
     // get classinfo
-    assert(tinfo->ty == Tclass);
-    TypeClass *tc = (TypeClass *)tinfo;
-
-    tc->sym->codegen(Type::sir);
-
     sinits.push_back(tc->sym->ir.irStruct->getClassInfoSymbol());
 
     // create the inititalizer
@@ -873,6 +874,11 @@
     Logger::println("TypeInfoInterfaceDeclaration::llvmDefine() %s", toChars());
     LOG_SCOPE;
 
+    // make sure interface is resolved
+    assert(tinfo->ty == Tclass);
+    TypeClass *tc = (TypeClass *)tinfo;
+    tc->sym->codegen(Type::sir);
+
     // init typeinfo class
     ClassDeclaration* base = Type::typeinfointerface;
     assert(base);
@@ -890,9 +896,6 @@
     sinits.push_back(llvm::ConstantPointerNull::get(getPtrToType(LLType::Int8Ty)));
 
     // get classinfo
-    assert(tinfo->ty == Tclass);
-    TypeClass *tc = (TypeClass *)tinfo;
-
     sinits.push_back(tc->sym->ir.irStruct->getClassInfoSymbol());
 
     // create the inititalizer