diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-14 00:56:55 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-14 00:56:55 +0000 |
commit | 16a0808b7992db2c2ba78b387e1732bbb0fb371b (patch) | |
tree | 492acd9bfef16524c869524617f35e237aa3c1b1 /lib/CodeGen/TargetABIInfo.cpp | |
parent | 018ba5ab0671d9b6eefecaffc118c869bea151a1 (diff) |
Some minor clang/ARM/AAPCS tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetABIInfo.cpp')
-rw-r--r-- | lib/CodeGen/TargetABIInfo.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/TargetABIInfo.cpp b/lib/CodeGen/TargetABIInfo.cpp index 6d95adad86..1dd88bb481 100644 --- a/lib/CodeGen/TargetABIInfo.cpp +++ b/lib/CodeGen/TargetABIInfo.cpp @@ -1527,11 +1527,21 @@ ABIArgInfo ARMABIInfo::classifyReturnType(QualType RetTy, // Otherwise this is an AAPCS variant. + if (isEmptyRecord(Context, RetTy, true)) + return ABIArgInfo::getIgnore(); + // Aggregates <= 4 bytes are returned in r0; other aggregates // are returned indirectly. uint64_t Size = Context.getTypeSize(RetTy); - if (Size <= 32) + if (Size <= 32) { + // Return in the smallest viable integer type. + if (Size <= 8) + return ABIArgInfo::getCoerce(llvm::Type::getInt8Ty(VMContext)); + if (Size <= 16) + return ABIArgInfo::getCoerce(llvm::Type::getInt16Ty(VMContext)); return ABIArgInfo::getCoerce(llvm::Type::getInt32Ty(VMContext)); + } + return ABIArgInfo::getIndirect(0); } |