summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2011-08-01 23:39:04 +0000
committerBob Wilson <bob.wilson@apple.com>2011-08-01 23:39:04 +0000
commit8e2b75dbad1351446435edaa982052ce4096518e (patch)
tree0c898bac080b1da2c666a2521331d0e345869a4d /clang/lib/CodeGen/TargetInfo.cpp
parent3022d6711d2ddfb0726c84737de0ee67c4b62d58 (diff)
downloadbcm5719-llvm-8e2b75dbad1351446435edaa982052ce4096518e.tar.gz
bcm5719-llvm-8e2b75dbad1351446435edaa982052ce4096518e.zip
Revert "Re-enable byval for ARM in clang. rdar://problem/7662569"
This reverts commit 67d097e1232b7d66f58989c16a45b8a11721f76e. We found a miscompile with ARM byval, which is still being investigated. In the meantime, this works around the problem by disabling ARM byval. Conflicts: lib/CodeGen/TargetInfo.cpp llvm-svn: 136662
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 167a0b12b88..9dbd11cb487 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -2400,21 +2400,17 @@ 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.
llvm::Type* ElemTy;
unsigned SizeRegs;
- if (getContext().getTypeSizeInChars(Ty) <= CharUnits::fromQuantity(64)) {
- ElemTy = llvm::Type::getInt32Ty(getVMContext());
- SizeRegs = (getContext().getTypeSize(Ty) + 31) / 32;
- } else 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;
+ } else {
+ ElemTy = llvm::Type::getInt32Ty(getVMContext());
+ SizeRegs = (getContext().getTypeSize(Ty) + 31) / 32;
}
llvm::Type *STy =
OpenPOWER on IntegriCloud