@@ -78,15 +78,11 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
7878 // / then loads the result into DestPtr.
7979 void EmitAggLoadOfLValue (const Expr *E);
8080
81- enum ExprValueKind {
82- EVK_RValue,
83- EVK_NonRValue
84- };
85-
8681 // / EmitFinalDestCopy - Perform the final copy to DestPtr, if desired.
8782 // / SrcIsRValue is true if source comes from an RValue.
8883 void EmitFinalDestCopy (QualType type, const LValue &src,
89- ExprValueKind SrcValueKind = EVK_NonRValue);
84+ CodeGenFunction::ExprValueKind SrcValueKind =
85+ CodeGenFunction::EVK_NonRValue);
9086 void EmitFinalDestCopy (QualType type, RValue src);
9187 void EmitCopy (QualType type, const AggValueSlot &dest,
9288 const AggValueSlot &src);
@@ -348,12 +344,13 @@ void AggExprEmitter::withReturnValueSlot(
348344void AggExprEmitter::EmitFinalDestCopy (QualType type, RValue src) {
349345 assert (src.isAggregate () && " value must be aggregate value!" );
350346 LValue srcLV = CGF.MakeAddrLValue (src.getAggregateAddress (), type);
351- EmitFinalDestCopy (type, srcLV, EVK_RValue);
347+ EmitFinalDestCopy (type, srcLV, CodeGenFunction:: EVK_RValue);
352348}
353349
354350// / EmitFinalDestCopy - Perform the final copy to DestPtr, if desired.
355- void AggExprEmitter::EmitFinalDestCopy (QualType type, const LValue &src,
356- ExprValueKind SrcValueKind) {
351+ void AggExprEmitter::EmitFinalDestCopy (
352+ QualType type, const LValue &src,
353+ CodeGenFunction::ExprValueKind SrcValueKind) {
357354 // If Dest is ignored, then we're evaluating an aggregate expression
358355 // in a context that doesn't care about the result. Note that loads
359356 // from volatile l-values force the existence of a non-ignored
@@ -365,7 +362,7 @@ void AggExprEmitter::EmitFinalDestCopy(QualType type, const LValue &src,
365362 LValue DstLV = CGF.MakeAddrLValue (
366363 Dest.getAddress (), Dest.isVolatile () ? type.withVolatile () : type);
367364
368- if (SrcValueKind == EVK_RValue) {
365+ if (SrcValueKind == CodeGenFunction:: EVK_RValue) {
369366 if (type.isNonTrivialToPrimitiveDestructiveMove () == QualType::PCK_Struct) {
370367 if (Dest.isPotentiallyAliased ())
371368 CGF.callCStructMoveAssignmentOperator (DstLV, src);
@@ -1317,15 +1314,13 @@ void AggExprEmitter::VisitChooseExpr(const ChooseExpr *CE) {
13171314
13181315void AggExprEmitter::VisitVAArgExpr (VAArgExpr *VE) {
13191316 Address ArgValue = Address::invalid ();
1320- Address ArgPtr = CGF.EmitVAArg (VE, ArgValue);
1317+ CGF.EmitVAArg (VE, ArgValue, Dest );
13211318
13221319 // If EmitVAArg fails, emit an error.
1323- if (!ArgPtr .isValid ()) {
1320+ if (!ArgValue .isValid ()) {
13241321 CGF.ErrorUnsupported (VE, " aggregate va_arg expression" );
13251322 return ;
13261323 }
1327-
1328- EmitFinalDestCopy (VE->getType (), CGF.MakeAddrLValue (ArgPtr, VE->getType ()));
13291324}
13301325
13311326void AggExprEmitter::VisitCXXBindTemporaryExpr (CXXBindTemporaryExpr *E) {
@@ -2027,6 +2022,13 @@ LValue CodeGenFunction::EmitAggExprToLValue(const Expr *E) {
20272022 return LV;
20282023}
20292024
2025+ void CodeGenFunction::EmitAggFinalDestCopy (QualType Type, AggValueSlot Dest,
2026+ const LValue &Src,
2027+ ExprValueKind SrcKind) {
2028+ return AggExprEmitter (*this , Dest, Dest.isIgnored ())
2029+ .EmitFinalDestCopy (Type, Src, SrcKind);
2030+ }
2031+
20302032AggValueSlot::Overlap_t
20312033CodeGenFunction::getOverlapForFieldInit (const FieldDecl *FD) {
20322034 if (!FD->hasAttr <NoUniqueAddressAttr>() || !FD->getType ()->isRecordType ())
0 commit comments