aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-11-25 22:21:48 +0000
committerAnders Carlsson <andersca@mac.com>2008-11-25 22:21:48 +0000
commitad3d6917dabbdab3399ff8307240aad58247d2e3 (patch)
tree2558300aafe63dc380f0771e4454fd7a9e92d880 /lib/CodeGen/CGCall.cpp
parenta55e52c0802cae3b7c366a05c461d3d15074c1a3 (diff)
Handle returning complex types that get coerced. Fixes PR3131
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 1fc4143d60..220586db58 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -868,7 +868,10 @@ RValue CodeGenFunction::EmitCall(llvm::Value *Callee,
llvm::PointerType::getUnqual(RetAI.getCoerceToType());
llvm::Value *V = CreateTempAlloca(ConvertType(RetTy), "tmp");
Builder.CreateStore(CI, Builder.CreateBitCast(V, CoerceToPTy));
- return RValue::getAggregate(V);
+ if (RetTy->isAnyComplexType())
+ return RValue::getComplex(LoadComplexFromAddr(V, false));
+ else
+ return RValue::getAggregate(V);
}
case ABIArgInfo::ByVal: