diff options
author | Devang Patel <dpatel@apple.com> | 2007-11-08 00:32:12 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-11-08 00:32:12 +0000 |
commit | ec51171319f90ddec80fab09cfc08fcb5ce0171a (patch) | |
tree | 7453c6c3c4598746bc34382b3edd64f81adc3976 /clang/CodeGen/CodeGenTypes.cpp | |
parent | 2419ac87928e851d555075c9e7f2d93528258fea (diff) | |
download | bcm5719-llvm-ec51171319f90ddec80fab09cfc08fcb5ce0171a.tar.gz bcm5719-llvm-ec51171319f90ddec80fab09cfc08fcb5ce0171a.zip |
Add assert for the case that is not handled.
struct { char a; short b:2; };
llvm-svn: 43859
Diffstat (limited to 'clang/CodeGen/CodeGenTypes.cpp')
-rw-r--r-- | clang/CodeGen/CodeGenTypes.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/CodeGen/CodeGenTypes.cpp b/clang/CodeGen/CodeGenTypes.cpp index 30ef78f333a..5f040bbb802 100644 --- a/clang/CodeGen/CodeGenTypes.cpp +++ b/clang/CodeGen/CodeGenTypes.cpp @@ -399,7 +399,12 @@ void RecordOrganizer::layoutStructFields(const ASTRecordLayout &RL) { 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); |