=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,Theo de
Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>,
=?utf-8?q?Théo?= De Magalhaes <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -3231,6 +3259,22 @@ void MicrosoftRecordLayoutBuilder::finalizeLayout(const
RecordDecl *RD) {
Size = Context.toCharUnitsFromBits(External.Size);
if (External.Align)
Alignment = Context.toCharUnitsFromBits(External.Align);
+ return;
+ }
+ unsigned CharBitNum = Context.getTargetInfo().getCharWidth();
+ uint64_t DataSizeInBits = Context.toBits(DataSize);
----------------
theomagellan wrote:
You were right, using DataSize did create issues while using certain alignment
attributes. I added some in the test file.
Now, 1 byte is artificially added to `UnpaddedSizeInBits` when `Size` is zero
before aligning the empty struct to its alignment. This allows to keep the
checks as they used to be (using Size instead of DataSize) and also takes care
of the empty struct case.
Thank you for catching that case!
https://github.com/llvm/llvm-project/pull/134426
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits