mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-28 22:21:31 +03:00
Merge remote-tracking branch 'origin/master' into merge-2.110
This commit is contained in:
commit
c271cf9fae
6 changed files with 79 additions and 17 deletions
|
@ -148,8 +148,9 @@ void AggrTypeBuilder::addAggregate(
|
|||
const uint64_t f_begin = field->offset;
|
||||
const uint64_t f_end = f_begin + fieldSize;
|
||||
|
||||
// use an i8 array for bit field groups
|
||||
const auto llType =
|
||||
isBitField ? LLIntegerType::get(gIR->context(), fieldSize * 8)
|
||||
isBitField ? llvm::ArrayType::get(getI8Type(), fieldSize)
|
||||
: DtoMemType(field->type);
|
||||
|
||||
// check for overlap with existing fields (on a byte level, not bits)
|
||||
|
@ -214,12 +215,8 @@ void AggrTypeBuilder::addAggregate(
|
|||
fieldSize = af.size;
|
||||
} else {
|
||||
fieldAlignment = getABITypeAlign(llType);
|
||||
if (vd->isBitFieldDeclaration()) {
|
||||
fieldSize = af.size; // an IR integer of possibly non-power-of-2 size
|
||||
} else {
|
||||
fieldSize = getTypeAllocSize(llType);
|
||||
assert(fieldSize <= af.size);
|
||||
}
|
||||
fieldSize = getTypeAllocSize(llType);
|
||||
assert(fieldSize <= af.size);
|
||||
}
|
||||
|
||||
// advance offset to right past this field
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue