mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Support structs that are merely a forward reference. See mini/forwdecl1.d
This commit is contained in:
@@ -131,11 +131,17 @@ void DtoResolveStruct(StructDeclaration* sd)
|
||||
Logger::println("DtoResolveStruct(%s): %s", sd->toChars(), sd->loc.toChars());
|
||||
LOG_SCOPE;
|
||||
|
||||
if (sd->prot() == PROTprivate && sd->getModule() != gIR->dmodule)
|
||||
Logger::println("using a private struct from outside its module");
|
||||
|
||||
TypeStruct* ts = (TypeStruct*)sd->type->toBasetype();
|
||||
|
||||
// this struct is a forward declaration
|
||||
// didn't even know had those ...
|
||||
if (sd->sizeok != 1)
|
||||
{
|
||||
sd->ir.irStruct = new IrStruct(ts);
|
||||
ts->ir.type = new llvm::PATypeHolder(llvm::OpaqueType::get());
|
||||
return;
|
||||
}
|
||||
|
||||
bool ispacked = (ts->alignsize() == 1);
|
||||
|
||||
IrStruct* irstruct = new IrStruct(ts);
|
||||
|
||||
Reference in New Issue
Block a user