Minor simplification.

llvm-svn: 70091
This commit is contained in:
Eli Friedman 2009-04-25 22:44:54 +00:00
parent 7524de1da2
commit 50322773b7
1 changed files with 2 additions and 7 deletions

View File

@ -529,13 +529,8 @@ void RecordOrganizer::layoutStructFields(const ASTRecordLayout &RL) {
uint64_t size = CGT.getTargetData().getTypePaddedSizeInBits(Ty);
if (Field->isBitField()) {
Expr *BitWidth = Field->getBitWidth();
llvm::APSInt FieldSize(32);
bool isBitField =
BitWidth->isIntegerConstantExpr(FieldSize, CGT.getContext());
assert(isBitField && "Invalid BitField size expression");
isBitField=isBitField; // silence warning.
uint64_t BitFieldSize = FieldSize.getZExtValue();
uint64_t BitFieldSize =
Field->getBitWidth()->EvaluateAsInt(CGT.getContext()).getZExtValue();
// Bitfield field info is different from other field info;
// it actually ignores the underlying LLVM struct because