diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-05-08 20:21:04 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-08 20:21:04 +0000 |
commit | f7fff322debe0b7256fe4dbc1103a3c2b43c379a (patch) | |
tree | ef2e73fdf979248feb4a6ac401ef7e5b5eecc0b7 /lib/CodeGen/CGCall.cpp | |
parent | c001e89b920504154bd0b1832e6feacd28fbfa58 (diff) |
Darwin x86_32: Ignore arrays of empty structures inside records.
- This eliminates 5/1000 failures on return-types-32, on the current
ABITest config.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71250 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 27322525bb..e9f2bba303 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/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; |