aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp7
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;