@@ -78,15 +78,11 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
78
78
// / then loads the result into DestPtr.
79
79
void EmitAggLoadOfLValue (const Expr *E);
80
80
81
- enum ExprValueKind {
82
- EVK_RValue,
83
- EVK_NonRValue
84
- };
85
-
86
81
// / EmitFinalDestCopy - Perform the final copy to DestPtr, if desired.
87
82
// / SrcIsRValue is true if source comes from an RValue.
88
83
void EmitFinalDestCopy (QualType type, const LValue &src,
89
- ExprValueKind SrcValueKind = EVK_NonRValue);
84
+ CodeGenFunction::ExprValueKind SrcValueKind =
85
+ CodeGenFunction::EVK_NonRValue);
90
86
void EmitFinalDestCopy (QualType type, RValue src);
91
87
void EmitCopy (QualType type, const AggValueSlot &dest,
92
88
const AggValueSlot &src);
@@ -348,12 +344,13 @@ void AggExprEmitter::withReturnValueSlot(
348
344
void AggExprEmitter::EmitFinalDestCopy (QualType type, RValue src) {
349
345
assert (src.isAggregate () && " value must be aggregate value!" );
350
346
LValue srcLV = CGF.MakeAddrLValue (src.getAggregateAddress (), type);
351
- EmitFinalDestCopy (type, srcLV, EVK_RValue);
347
+ EmitFinalDestCopy (type, srcLV, CodeGenFunction:: EVK_RValue);
352
348
}
353
349
354
350
// / 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) {
357
354
// If Dest is ignored, then we're evaluating an aggregate expression
358
355
// in a context that doesn't care about the result. Note that loads
359
356
// from volatile l-values force the existence of a non-ignored
@@ -365,7 +362,7 @@ void AggExprEmitter::EmitFinalDestCopy(QualType type, const LValue &src,
365
362
LValue DstLV = CGF.MakeAddrLValue (
366
363
Dest.getAddress (), Dest.isVolatile () ? type.withVolatile () : type);
367
364
368
- if (SrcValueKind == EVK_RValue) {
365
+ if (SrcValueKind == CodeGenFunction:: EVK_RValue) {
369
366
if (type.isNonTrivialToPrimitiveDestructiveMove () == QualType::PCK_Struct) {
370
367
if (Dest.isPotentiallyAliased ())
371
368
CGF.callCStructMoveAssignmentOperator (DstLV, src);
@@ -1317,15 +1314,13 @@ void AggExprEmitter::VisitChooseExpr(const ChooseExpr *CE) {
1317
1314
1318
1315
void AggExprEmitter::VisitVAArgExpr (VAArgExpr *VE) {
1319
1316
Address ArgValue = Address::invalid ();
1320
- Address ArgPtr = CGF.EmitVAArg (VE, ArgValue);
1317
+ CGF.EmitVAArg (VE, ArgValue, Dest );
1321
1318
1322
1319
// If EmitVAArg fails, emit an error.
1323
- if (!ArgPtr .isValid ()) {
1320
+ if (!ArgValue .isValid ()) {
1324
1321
CGF.ErrorUnsupported (VE, " aggregate va_arg expression" );
1325
1322
return ;
1326
1323
}
1327
-
1328
- EmitFinalDestCopy (VE->getType (), CGF.MakeAddrLValue (ArgPtr, VE->getType ()));
1329
1324
}
1330
1325
1331
1326
void AggExprEmitter::VisitCXXBindTemporaryExpr (CXXBindTemporaryExpr *E) {
@@ -2027,6 +2022,13 @@ LValue CodeGenFunction::EmitAggExprToLValue(const Expr *E) {
2027
2022
return LV;
2028
2023
}
2029
2024
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
+
2030
2032
AggValueSlot::Overlap_t
2031
2033
CodeGenFunction::getOverlapForFieldInit (const FieldDecl *FD) {
2032
2034
if (!FD->hasAttr <NoUniqueAddressAttr>() || !FD->getType ()->isRecordType ())
0 commit comments