diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-11 22:05:26 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-11 22:05:26 +0000 |
commit | e06a75f4c8ea30b6a99d5aa1dce5feda64da09c6 (patch) | |
tree | d2b0062f0b9252c3a134bcf68cec252931c52e87 /lib/CodeGen/CGCall.cpp | |
parent | b2dea734527ae75281642a1c6ace28f9e00cab11 (diff) |
x86_32 ABI: Don't try and expand structures with bitfields.
- This is an ABI incompatiblity, but this is not likely to be a huge
deal in practice. For now we at least generate self consistent code
instead of crashing.
- <rdar://problem/6657601> x86-32 ABI: Bitfields in small structures
are not passed correctly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66713 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index e9ac5c9751..9e52cbb79c 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -215,14 +215,14 @@ static bool areAllFields32Or64BitBasicType(const RecordDecl *RD, if (!is32Or64BitBasicType(FD->getType(), Context)) return false; - // If this is a bit-field we need to make sure it is still a - // 32-bit or 64-bit type. - if (Expr *BW = FD->getBitWidth()) { - unsigned Width = BW->getIntegerConstantExprValue(Context).getZExtValue(); - if (Width <= 16) - return false; - } + // FIXME: Reject bitfields wholesale; there are two problems, we + // don't know how to expand them yet, and the predicate for + // telling if a bitfield still counts as "basic" is more + // complicated than what we were doing previously. + if (FD->isBitField()) + return false; } + return true; } |