Merge remote-tracking branch 'origin/master' into bitfields

Conflicts:
	gen/dvalue.cpp
	gen/llvmhelpers.cpp
	gen/structs.cpp
	gen/toir.cpp
	ir/irtypeaggr.cpp
This commit is contained in:
Martin Kinkelin 2022-09-10 16:20:54 +02:00
commit 78fdc135e4
44 changed files with 666 additions and 543 deletions

View file

@ -145,7 +145,7 @@ LLValue *DtoUnpaddedStruct(Type *dty, LLValue *v) {
LLValue *newval = llvm::UndefValue::get(DtoUnpaddedStructType(dty));
for (unsigned i = 0; i < fields.length; i++) {
LLValue *fieldptr = DtoIndexAggregate(v, sty->sym, fields[i]);
LLValue *fieldptr = DtoLVal(DtoIndexAggregate(v, sty->sym, fields[i]));
LLValue *fieldval;
if (fields[i]->type->ty == TY::Tstruct) {
// Nested structs are the only members that can contain padding
@ -153,7 +153,7 @@ LLValue *DtoUnpaddedStruct(Type *dty, LLValue *v) {
} else {
assert(!fields[i]->isBitFieldDeclaration());
fieldptr = DtoBitCast(fieldptr, DtoPtrToType(fields[i]->type));
fieldval = DtoLoad(fieldptr);
fieldval = DtoLoad(DtoType(fields[i]->type), fieldptr);
}
newval = DtoInsertValue(newval, fieldval, i);
}
@ -167,7 +167,7 @@ void DtoPaddedStruct(Type *dty, LLValue *v, LLValue *lval) {
VarDeclarations &fields = sty->sym->fields;
for (unsigned i = 0; i < fields.length; i++) {
LLValue *fieldptr = DtoIndexAggregate(lval, sty->sym, fields[i]);
LLValue *fieldptr = DtoLVal(DtoIndexAggregate(lval, sty->sym, fields[i]));
LLValue *fieldval = DtoExtractValue(v, i);
if (fields[i]->type->ty == TY::Tstruct) {
// Nested structs are the only members that can contain padding