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
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 2732252..e9f2bba 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -350,6 +350,13 @@
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;