================
@@ -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);
----------------
rjmccall wrote:

Does MSVC actually use the ARM ABI? Windows usually just follows its own rules. 
Ah, well, doesn't really matter.

It seems natural that this would use the alignment of the base class rather 
than its natural alignment, since that amounts to a consistent rule for all 
subobjects. I mean, it doesn't *really* make sense to only ignore non-natural 
alignment at the outermost level, but frankly this is a silly rule to begin 
with. Every justification for honoring non-natural alignment at the subobject 
level doubles as an argument for honoring non-natural alignment at the 
aggregate level, which is the most sensible thing to do, and yet here we are.

Normally, whenever we're talking about base class alignment, we have to be very 
careful to pick correctly between base-subobject alignment and complete-object 
alignment. This should probably be base-subobject alignment, but I don't think 
it's possible to detect a difference because any class with virtual bases is 
not trivially-copyable and so will always be passed indirectly.

Darwin is just going to have to not follow the ARM spec here. We will not 
consider an ABI break for something like this.

https://github.com/llvm/llvm-project/pull/135564
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to