================
@@ -3014,6 +3014,16 @@ 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()) {
+ CharUnits Align = CGF.getContext().getTypeAlignInChars(Ty);
+ VAListAddr = CGF.Builder.CreateStructGEP(VAListAddr, 2);
+ llvm::Value *Load = CGF.Builder.CreateLoad(VAListAddr);
+ llvm::Value *Offset = llvm::ConstantInt::get(CGF.Int32Ty, 0);
+ Load = CGF.Builder.CreateGEP(CGF.Int8Ty, Load, Offset);
+ return Address(Load, CGF.ConvertTypeForMem(Ty), Align);
----------------
efriedma-quic wrote:
I don't think the address here is guaranteed to be appropriately aligned. It's
probably better to create a temporary like I suggested before.
Also, a GEP with offset 0 does nothing.
https://github.com/llvm/llvm-project/pull/77907
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits