[cfe-commits] r43859 - /cfe/trunk/CodeGen/CodeGenTypes.cpp
Devang Patel
dpatel at apple.com
Wed Nov 7 16:32:12 PST 2007
Author: dpatel
Date: Wed Nov 7 18:32:12 2007
New Revision: 43859
URL: http://llvm.org/viewvc/llvm-project?rev=43859&view=rev
Log:
Add assert for the case that is not handled.
struct { char a; short b:2; };
Modified:
cfe/trunk/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=43859&r1=43858&r2=43859&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Wed Nov 7 18:32:12 2007
@@ -399,7 +399,12 @@
assert (isBitField && "Invalid BitField size expression");
uint64_t BitFieldSize = FieldSize.getZExtValue();
if (ExtraBits == 0) {
+ const llvm::Type *PrevTy = LLVMFields.back();
const llvm::Type *Ty = CGT.ConvertType(FD->getType());
+ assert (CGT.getTargetData().getTypeSizeInBits(PrevTy) >=
+ CGT.getTargetData().getTypeSizeInBits(Ty)
+ && "FIXME Unable to handle bit field. Reuse last field");
+
// Calculate extra bits available in this bitfield.
ExtraBits = CGT.getTargetData().getTypeSizeInBits(Ty) - BitFieldSize;
addLLVMField(Ty, BitFieldSize, FD, 0, ExtraBits);
More information about the cfe-commits
mailing list