================
@@ -2161,6 +2161,21 @@ static RValue EmitLoadOfMatrixLValue(LValue LV, 
SourceLocation Loc,
   return RValue::get(CGF.EmitLoadOfScalar(LV, Loc));
 }
 
+RValue CodeGenFunction::EmitLoadOfAnyValue(LValue LV, AggValueSlot Slot,
+                                           SourceLocation Loc) {
+  QualType Ty = LV.getType();
+  switch (getEvaluationKind(Ty)) {
+  case TEK_Scalar:
+    return EmitLoadOfLValue(LV, Loc);
+  case TEK_Complex:
+    return RValue::getComplex(EmitLoadOfComplex(LV, Loc));
+  case TEK_Aggregate:
+    EmitAggFinalDestCopy(Ty, Slot, LV, EVK_RValue);
----------------
rjmccall wrote:

I believe the EVK argument here is mean to represent the kind of value that the 
l-value represents.  In that case, it's an l-value — we need to preserve the 
underlying `va_list` storage and not treat it as something we own, because it's 
possible to iterate varargs twice.  I'm not sure it makes a practical 
difference here because variadic argumets are required to be trivial, but it's 
better to be accurate.

https://github.com/llvm/llvm-project/pull/94635
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to