[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode
wanglei via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 24 02:29:02 PDT 2023
wangleiat added a comment.
>>> If we want to ignore empty structures, it is not enough to only modify psABI, because the current implementations of gcc and clang do not ignore empty structures in all cases. For example:
>>>
>>> struct { struct{}; int i; }; // in this case, the empty struct is not ignored.
>>> struct { struct{}; float f; }; // ignored.
>>
>> This is the same behavior as RISC-V. While attempting to pass a struct through FPRs, the empty field is ignored. But if passing through FPR does not work and it's passed through GPRs, the empty fields are not ignored:
Yes, but our psABI still differs from RISC-V in the description of parameter passing, and it would be better to have consistent behavior regardless of whether there are floating points or not.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151298/new/
https://reviews.llvm.org/D151298
More information about the cfe-commits
mailing list