[clang] [X86_32] Teach X86_32 va_arg to ignore empty structs. (PR #86075)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 13:38:08 PDT 2024


================
@@ -1069,6 +1069,10 @@ Address X86_32ABIInfo::EmitVAArg(CodeGenFunction &CGF,
 
   auto TypeInfo = getContext().getTypeInfoInChars(Ty);
 
+  // Empty records are ignored for parameter passing purposes on non-Windows.
+  if (!IsWin32StructABI && isEmptyRecord(getContext(), Ty, true))
+    return CGF.CreateMemTemp(Ty);
----------------
efriedma-quic wrote:

I'd prefer to use classifyArgumentType, like we do for the 64-bit case, instead of trying to duplicate the logic.

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


More information about the cfe-commits mailing list