mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-18 09:49:02 +02:00
Fixed forward referenced structs.
This commit is contained in:
@@ -36,6 +36,10 @@ void DtoResolveStruct(StructDeclaration* sd)
|
|||||||
// make sure type exists
|
// make sure type exists
|
||||||
DtoType(sd->type);
|
DtoType(sd->type);
|
||||||
|
|
||||||
|
// if it's a forward declaration, all bets are off. The type should be enough
|
||||||
|
if (sd->sizeok != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
// create the IrStruct
|
// create the IrStruct
|
||||||
IrStruct* irstruct = new IrStruct(sd);
|
IrStruct* irstruct = new IrStruct(sd);
|
||||||
sd->ir.irStruct = irstruct;
|
sd->ir.irStruct = irstruct;
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ const llvm::Type* IrTypeStruct::buildType()
|
|||||||
IF_LOG Logger::println("Building struct type %s @ %s", sd->toPrettyChars(), sd->locToChars());
|
IF_LOG Logger::println("Building struct type %s @ %s", sd->toPrettyChars(), sd->locToChars());
|
||||||
LOG_SCOPE;
|
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.
|
// find the fields that contribute to the default initializer.
|
||||||
// these will define the default type.
|
// these will define the default type.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user