From d2490a91341b57df7a7e54f8a707e7ecde2eeb4e Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Thu, 24 Dec 2009 20:40:36 +0000 Subject: Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92142 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprAgg.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/CodeGen/CGExprAgg.cpp') 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); } -- cgit v1.2.3-70-g09d2