IRgen support for calls to functions that return references to aggregate exressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72479 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 00c1f8d..59c0052 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -186,6 +186,11 @@
}
void AggExprEmitter::VisitCallExpr(const CallExpr *E) {
+ if (E->getCallReturnType()->isReferenceType()) {
+ EmitAggLoadOfLValue(E);
+ return;
+ }
+
RValue RV = CGF.EmitCallExpr(E);
EmitFinalDestCopy(E, RV);
}