aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-10-23 02:04:01 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-10-23 02:04:01 +0000
commit5f14fcbd45870585a136ae735d29d0e085c0d7f8 (patch)
tree6d02cc6b78fe6c9c5422c1e048e338791b9c8602 /lib/CodeGen
parentbb531706602048716a6c36f1ea59f277be9f6753 (diff)
Don't try to use inreg with 0 sized structs. Thanks to Eli for reporting the
regression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/TargetInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index a9e11cb954..6a929a17cc 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -810,6 +810,10 @@ bool X86_32ABIInfo::shouldUseInReg(QualType Ty, unsigned &FreeRegs) const {
return false;
unsigned SizeInRegs = (getContext().getTypeSize(Ty) + 31) / 32;
+
+ if (SizeInRegs == 0)
+ return false;
+
if (SizeInRegs > FreeRegs) {
FreeRegs = 0;
return false;