[llvm-commits] [llvm-gcc-4.2] r49390 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Devang Patel
dpatel at apple.com
Tue Apr 8 11:08:24 PDT 2008
Author: dpatel
Date: Tue Apr 8 13:08:24 2008
New Revision: 49390
URL: http://llvm.org/viewvc/llvm-project?rev=49390&view=rev
Log:
Store multiple return values in destination aggregate value.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=49390&r1=49389&r2=49390&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Apr 8 13:08:24 2008
@@ -2644,6 +2644,18 @@
Call->setName("tmp");
+ if (Client.isAggrReturn()) {
+ const StructType *STy = cast<StructType>(Call->getType());
+ unsigned NumElements = STy->getNumElements();
+ for (unsigned i = 0; i < NumElements; i++) {
+ //DPATEL
+ Value *GEP = Builder.CreateStructGEP(DestLoc->Ptr, i, "mrv_gep");
+ GetResultInst *GR = Builder.CreateGetResult(Call, i, "mrv_gr");
+ Builder.CreateStore(GR, GEP, DestLoc->Volatile);
+ }
+ return 0;
+ }
+
// If the caller expects an aggregate, we have a situation where the ABI for
// the current target specifies that the aggregate be returned in scalar
// registers even though it is an aggregate. We must bitconvert the scalar
More information about the llvm-commits
mailing list