[clang] [clang][CodeGen] Return RValue from `EmitVAArg` (PR #94635)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 6 10:38:57 PDT 2024


================
@@ -1328,15 +1328,15 @@ void AggExprEmitter::VisitChooseExpr(const ChooseExpr *CE) {
 
 void AggExprEmitter::VisitVAArgExpr(VAArgExpr *VE) {
   Address ArgValue = Address::invalid();
-  Address ArgPtr = CGF.EmitVAArg(VE, ArgValue);
+  RValue ArgPtr = CGF.EmitVAArg(VE, ArgValue);
 
   // If EmitVAArg fails, emit an error.
-  if (!ArgPtr.isValid()) {
+  if (!ArgValue.isValid()) {
     CGF.ErrorUnsupported(VE, "aggregate va_arg expression");
     return;
   }
 
-  EmitFinalDestCopy(VE->getType(), CGF.MakeAddrLValue(ArgPtr, VE->getType()));
+  EmitFinalDestCopy(VE->getType(), ArgPtr);
----------------
rjmccall wrote:

It would be more standard here to pass the dest slot down.

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


More information about the cfe-commits mailing list