[cfe-commits] r70091 - /cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
Eli Friedman
eli.friedman at gmail.com
Sat Apr 25 15:44:55 PDT 2009
Author: efriedma
Date: Sat Apr 25 17:44:54 2009
New Revision: 70091
URL: http://llvm.org/viewvc/llvm-project?rev=70091&view=rev
Log:
Minor simplification.
Modified:
cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=70091&r1=70090&r2=70091&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTypes.cpp Sat Apr 25 17:44:54 2009
@@ -529,13 +529,8 @@
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
More information about the cfe-commits
mailing list