[clang] [ARM, AArch64] Fix passing of structures with aligned base classes (PR #135564)
Harald van Dijk via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 05:30:46 PDT 2025
================
@@ -1302,6 +1302,7 @@ ItaniumRecordLayoutBuilder::LayoutBase(const BaseSubobjectInfo *Base) {
setSize(std::max(getSize(), Offset + Layout.getSize()));
// Remember max struct/class alignment.
+ UnadjustedAlignment = std::max(UnadjustedAlignment, PreferredBaseAlign);
----------------
hvdijk wrote:
>From what I can see from the Clang code, for non-HFAs/HVAs, yes, the alignment of the composite type is used rather than the natural alignment, however for HFAs/HVAs, the alignment of the element type is used without regard to the alignment of the composite type. However, this does not seem like it makes any difference because Darwin doesn't have that rule that 16-byte-aligned types are allocated to even-numbered registers anyway, https://godbolt.org/z/qhbYo9c8M
https://github.com/llvm/llvm-project/pull/135564
More information about the cfe-commits
mailing list