Fixed forward referenced structs.

This commit is contained in:
Tomas Lindquist Olsen
2009-04-16 20:41:27 +02:00
parent 1437bd6b7e
commit 414e58a318
2 changed files with 8 additions and 0 deletions

View File

@@ -67,6 +67,10 @@ const llvm::Type* IrTypeStruct::buildType()
IF_LOG Logger::println("Building struct type %s @ %s", sd->toPrettyChars(), sd->locToChars());
LOG_SCOPE;
// if it's a forward declaration, all bets are off, stick with the opaque
if (sd->sizeok != 1)
return pa.get();
// find the fields that contribute to the default initializer.
// these will define the default type.