mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 09:00:33 +03:00
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:
commit
78fdc135e4
44 changed files with 666 additions and 543 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue