diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-10-23 02:04:01 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-10-23 02:04:01 +0000 |
commit | e2a9e90c88edb1d7466af50003b505cc1fe14b4b (patch) | |
tree | e5eb0cd9e6c89e75c98e55dcc5ef235d3009ead0 /clang/lib/CodeGen | |
parent | 4a792072ceea00696c9bbce3de74c348cce608b9 (diff) | |
download | bcm5719-llvm-e2a9e90c88edb1d7466af50003b505cc1fe14b4b.tar.gz bcm5719-llvm-e2a9e90c88edb1d7466af50003b505cc1fe14b4b.zip |
Don't try to use inreg with 0 sized structs. Thanks to Eli for reporting the
regression.
llvm-svn: 166461
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index a9e11cb9542..6a929a17ccd 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/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; |