From b17daf9ab790ae71aacad2cc4aa11cd8d86c25d1 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Fri, 4 Dec 2009 02:43:40 +0000 Subject: Make functions returning a struct indirectly evaluate the returned struct directly into the sret pointer. This is an optimization in C, but is required for correctness in C++ for classes with a non-trivial copy constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90526 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCall.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/CGCall.cpp') diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index decc73c6d4..62a5792d27 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -764,7 +764,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI, ComplexPairTy RT = LoadComplexFromAddr(ReturnValue, false); StoreComplexToAddr(RT, CurFn->arg_begin(), false); } else if (CodeGenFunction::hasAggregateLLVMType(RetTy)) { - EmitAggregateCopy(CurFn->arg_begin(), ReturnValue, RetTy); + // Do nothing; aggregrates get evaluated directly into the destination. } else { EmitStoreOfScalar(Builder.CreateLoad(ReturnValue), CurFn->arg_begin(), false, RetTy); -- cgit v1.2.3-70-g09d2