aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 0802e905ea..16249e4aab 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -272,6 +272,13 @@ void AggExprEmitter::VisitCallExpr(const CallExpr *E) {
return;
}
+ // If the struct doesn't require GC, we can just pass the destination
+ // directly to EmitCall.
+ if (!RequiresGCollection) {
+ CGF.EmitCallExpr(E, ReturnValueSlot(DestPtr, VolatileDest));
+ return;
+ }
+
RValue RV = CGF.EmitCallExpr(E);
EmitFinalDestCopy(E, RV);
}