mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-17 13:23:14 +01:00
Removed warnings on ignored aligns. Only do aligment on packed structs, align(1) struct Packed { ... }
Changed the way struct/class fields are added, first small part of cleaning up these... Make struct/class/union fields aware of any anonymous struct/union they might be part of, not yet really useful, but part of getting better union support.
This commit is contained in:
@@ -92,7 +92,7 @@ void DtoResolveStruct(StructDeclaration* sd)
|
||||
TypeStruct* ts = (TypeStruct*)sd->type->toBasetype();
|
||||
|
||||
// this struct is a forward declaration
|
||||
// didn't even know had those ...
|
||||
// didn't even know D had those ...
|
||||
if (sd->sizeok != 1)
|
||||
{
|
||||
sd->ir.irStruct = new IrStruct(ts);
|
||||
@@ -102,10 +102,21 @@ void DtoResolveStruct(StructDeclaration* sd)
|
||||
|
||||
bool ispacked = (ts->alignsize() == 1);
|
||||
|
||||
// create the IrStruct
|
||||
IrStruct* irstruct = new IrStruct(ts);
|
||||
sd->ir.irStruct = irstruct;
|
||||
gIR->structs.push_back(irstruct);
|
||||
|
||||
// add fields
|
||||
Array* fields = &sd->fields;
|
||||
for (int k=0; k < fields->dim; k++)
|
||||
{
|
||||
VarDeclaration* v = (VarDeclaration*)fields->data[k];
|
||||
Logger::println("Adding field: %s %s", v->type->toChars(), v->toChars());
|
||||
// init fields, used to happen in VarDeclaration::toObjFile
|
||||
irstruct->addField(v);
|
||||
}
|
||||
|
||||
irstruct->packed = ispacked;
|
||||
|
||||
bool thisModule = false;
|
||||
|
||||
Reference in New Issue
Block a user