mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Fixed forward referenced structs.
This commit is contained in:
@@ -36,6 +36,10 @@ void DtoResolveStruct(StructDeclaration* sd)
|
||||
// make sure type exists
|
||||
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
|
||||
IrStruct* irstruct = new IrStruct(sd);
|
||||
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());
|
||||
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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user