efriedma-quic wrote:

The proper fix here is probably to just delete the `return 
ABIArgInfo::getDirect(llvm::Type::getInt8Ty(getVMContext()));` from the empty 
struct codepath on aarch64.

Alignment shouldn't affect whether a class is empty.  The issue here is just 
that according to aarch64 AAPCS rules, there isn't supposed to be a special 
case for empty classes; they're supposed to be passed exactly the same way as 
non-empty classes.  If there's no alignment involved, that's the same as an i8; 
if there's alignment, though, that increases the size of the struct, and 
therefore the calling convention.  It looks like whoever wrote it wasn't 
considering that an empty struct can have size greater than one byte if 
alignment is involved.

The code you noted is supposed to handle two cases, neither of which are 
relevant to your testcase:

- Darwin-specific calling convention rules.
- GNU extensions for zero-size structs (which aren't allowed according to 
either C or C++ standards, but GNU invented a bunch of non-standard rules for 
them)

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

Reply via email to