summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-08 20:21:04 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-08 20:21:04 +0000
commit85f4028f2e9ddf04e96bfc0faf321ffc53502674 (patch)
tree4fd3e7bbe4f45b407b844108cd6e45ed4a66da43 /clang/lib/CodeGen/CGCall.cpp
parentfe9e3940ebac6ef90afa7e1a3af307366c120983 (diff)
downloadbcm5719-llvm-85f4028f2e9ddf04e96bfc0faf321ffc53502674.tar.gz
bcm5719-llvm-85f4028f2e9ddf04e96bfc0faf321ffc53502674.zip
Darwin x86_32: Ignore arrays of empty structures inside records.
- This eliminates 5/1000 failures on return-types-32, on the current ABITest config. llvm-svn: 71250
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 27322525bb2..e9f2bba303b 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -350,6 +350,13 @@ bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty,
if (isEmptyRecord(Context, FD->getType()))
continue;
+ // As are arrays of empty structures, but not generally, so we
+ // can't add this test higher in this routine.
+ if (const ConstantArrayType *AT =
+ Context.getAsConstantArrayType(FD->getType()))
+ if (isEmptyRecord(Context, AT->getElementType()))
+ continue;
+
// Check fields recursively.
if (!shouldReturnTypeInRegister(FD->getType(), Context))
return false;
OpenPOWER on IntegriCloud