3 Commits

Author SHA1 Message Date
Vladislav Dzhidzhoev
af6c0b6d8c [clang][CodeGen] Use base subobject type layout for potentially-overlapping fields
RecordLayoutBuilder assumes the size of a potentially-overlapping
class/struct field with non-zero size as the size of the base subobject
type corresponding to the field type.
Make CGRecordLayoutBuilder to acknowledge that in order to avoid incorrect
padding insertion.

Differential Revision: https://reviews.llvm.org/D139741
2023-02-17 15:11:42 +01:00
Vladislav Dzhidzhoev
19d300fb41 Revert "[clang][CodeGen] Use base subobject type layout for potentially-overlapping fields"
This reverts commit 731abdfdcc33d813e6c3b4b89eff307aa5c18083.

This commit breaks some tests in libcxx, e.g.
`std/utilities/expected/expected.expected/ctor/ctor.inplace.pass.cpp`
2022-12-15 18:12:26 +03:00
Vladislav Dzhidzhoev
731abdfdcc [clang][CodeGen] Use base subobject type layout for potentially-overlapping fields
RecordLayoutBuilder assumes the size of a potentially-overlapping field
with non-zero size as the size of the base subobject type corresponding
to the field type.
Make CGRecordLayoutBuilder to acknowledge that in order to avoid incorrect
padding insertion.

Differential Revision: https://reviews.llvm.org/D139741
2022-12-15 15:10:41 +03:00