[clang] [llvm] [clang][SPARC] Match zero-size struct lowering with GCC's (PR #217065)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 15 08:22:47 PST 2026
================
@@ -420,12 +435,11 @@ ABIArgInfo SparcV9ABIInfo::classifyType(QualType Ty, unsigned SizeLimit,
CoerceBuilder CB(VMContext, getDataLayout(), IsVarArg);
CB.addStruct(0, StrTy);
+
// All structs, even empty ones, should take up a register argument slot,
// so pin the minimum struct size to one bit.
- CB.pad(llvm::alignTo(
- std::max(CB.DL.getTypeSizeInBits(StrTy).getKnownMinValue(), uint64_t(1)),
- 64));
- RegOffset += PaddingSlots + CB.Size / 64;
----------------
koachan wrote:
My bad, the RegOffset line should stay, yes.
https://github.com/llvm/llvm-project/pull/217065
More information about the cfe-commits
mailing list