[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
Mon Apr 14 14:08:41 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:

Tested that this doesn't affect Darwin and Windows, but for Windows, that surprises me. Clang matches MSVC for AArch64 in *not* following AAPCS64 on Windows, despite the fact that Microsoft's [Overview of ARM64 ABI conventions > Parameter Passing](https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#parameter-passing) says "For non-variadic functions, the Windows ABI follows the rules specified by ARM for parameter passing. These rules are excerpted directly from the Procedure Call Standard for the AArch64 Architecture: [...]"

https://github.com/llvm/llvm-project/pull/135564


More information about the cfe-commits mailing list