Fixed class default initializers and type generation. Bug #260 is fixed.

This commit is contained in:
Tomas Lindquist Olsen 2009-04-27 03:40:40 +02:00
parent 3bd5cf70c2
commit ba38e15f0d
9 changed files with 169 additions and 44 deletions

View file

@ -44,13 +44,13 @@ void DtoResolveStruct(StructDeclaration* sd)
IrStruct* irstruct = new IrStruct(sd);
sd->ir.irStruct = irstruct;
// emit the initZ symbol
LLGlobalVariable* initZ = irstruct->getInitSymbol();
// perform definition
bool needs_def = mustDefineSymbol(sd);
if (needs_def)
{
// emit the initZ symbol
LLGlobalVariable* initZ = irstruct->getInitSymbol();
// set initZ initializer
initZ->setInitializer(irstruct->getDefaultInit());
}