aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-01 23:31:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-01 23:31:19 +0000
commit4cc753f4503931763cfb762a95928b44fcbe64e9 (patch)
tree47e9b4b7b61a12a1046023fadca4802067df3fb3 /lib/CodeGen/TargetInfo.cpp
parentf911eba72e6d7275e5cfdb79ab23fb2aa9cc01d0 (diff)
ARM/APCS: Pass Complex types following llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r--lib/CodeGen/TargetInfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 92ff312425..c0b5f655fa 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -1661,6 +1661,14 @@ ABIArgInfo ARMABIInfo::classifyReturnType(QualType RetTy,
if (isEmptyRecord(Context, RetTy, false))
return ABIArgInfo::getIgnore();
+ // Complex types are all returned as packed integers.
+ //
+ // FIXME: Consider using 2 x vector types if the back end handles them
+ // correctly.
+ if (RetTy->isAnyComplexType())
+ return ABIArgInfo::getCoerce(llvm::IntegerType::get(
+ VMContext, Context.getTypeSize(RetTy)));
+
// Integer like structures are returned in r0.
if (isIntegerLikeType(RetTy, Context, VMContext)) {
// Return in the smallest viable integer type.