summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-04-26 01:02:04 +0000
committerEric Christopher <echristo@apple.com>2011-04-26 01:02:04 +0000
commit6f095d613a406b64465b918d2cc47fe3e13ad8b8 (patch)
tree6915ea5d72918d9ece71cf1ade5114845709ba37 /clang/lib/CodeGen/TargetInfo.cpp
parentcae2fbd6fc0bc67a881aa6f7fc5e66432d744c63 (diff)
downloadbcm5719-llvm-6f095d613a406b64465b918d2cc47fe3e13ad8b8.tar.gz
bcm5719-llvm-6f095d613a406b64465b918d2cc47fe3e13ad8b8.zip
Temporarily revert r130176, it appears to have broken a few tests.
llvm-svn: 130179
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 668970a6ad2..0b244e8ba1e 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -2341,34 +2341,23 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty) const {
// Otherwise, pass by coercing to a structure of the appropriate size.
//
+ // FIXME: This is kind of nasty... but there isn't much choice because the ARM
+ // backend doesn't support byval.
// FIXME: This doesn't handle alignment > 64 bits.
const llvm::Type* ElemTy;
unsigned SizeRegs;
- if (getContext().getTypeSize(Ty) <= 32) {
- ElemTy = llvm::Type::getInt32Ty(getVMContext());
- SizeRegs = (getContext().getTypeSize(Ty) + 31) / 32;
- llvm::SmallVector<const llvm::Type*, 8> LLVMFields;
- LLVMFields.push_back(llvm::ArrayType::get(ElemTy, SizeRegs));
- const llvm::Type* STy = llvm::StructType::get(getVMContext(), LLVMFields,
- true);
- return ABIArgInfo::getDirect(STy);
- }
-
- if (getABIKind() == ARMABIInfo::APCS) {
- // Initial ARM ByVal support is APCS-only.
- return ABIArgInfo::getIndirect(0, /*ByVal=*/true);
- } else {
- // FIXME: This is kind of nasty... but there isn't much choice
- // because most of the ARM calling conventions don't yet support
- // byval.
+ if (getContext().getTypeAlign(Ty) > 32) {
ElemTy = llvm::Type::getInt64Ty(getVMContext());
SizeRegs = (getContext().getTypeSize(Ty) + 63) / 64;
- llvm::SmallVector<const llvm::Type*, 8> LLVMFields;
- LLVMFields.push_back(llvm::ArrayType::get(ElemTy, SizeRegs));
- const llvm::Type* STy = llvm::StructType::get(getVMContext(), LLVMFields,
- true);
- return ABIArgInfo::getDirect(STy);
+ } else {
+ ElemTy = llvm::Type::getInt32Ty(getVMContext());
+ SizeRegs = (getContext().getTypeSize(Ty) + 31) / 32;
}
+ std::vector<const llvm::Type*> LLVMFields;
+ LLVMFields.push_back(llvm::ArrayType::get(ElemTy, SizeRegs));
+ const llvm::Type* STy = llvm::StructType::get(getVMContext(), LLVMFields,
+ true);
+ return ABIArgInfo::getDirect(STy);
}
static bool isIntegerLikeType(QualType Ty, ASTContext &Context,
OpenPOWER on IntegriCloud