[clang] [X86_64] fix empty structure vaarg in c++ (PR #77907)
Phoebe Wang via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 19 00:10:55 PDT 2024
================
@@ -3014,6 +3014,11 @@ Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
ABIArgInfo AI = classifyArgumentType(Ty, 0, neededInt, neededSSE,
/*isNamedArg*/false);
+ // Empty records are ignored for parameter passing purposes.
+ if (AI.isIgnore()) {
+ return CGF.CreateMemTemp(Ty);
+ }
----------------
phoebewang wrote:
Does it behave differently between C and C++? Maybe adding a C test for it?
Besides, do not use parentheses for single line code.
https://github.com/llvm/llvm-project/pull/77907
More information about the cfe-commits
mailing list