diff options
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 643d4753250..7ff4ae91654 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -370,11 +370,8 @@ void ASTRecordLayout::LayoutField(const FieldDecl *FD, unsigned FieldNo, if (const Expr *BitWidthExpr = FD->getBitWidth()) { // TODO: Need to check this algorithm on other targets! // (tested on Linux-X86) - llvm::APSInt I(32); - bool BitWidthIsICE = - BitWidthExpr->isIntegerConstantExpr(I, Context); - assert (BitWidthIsICE && "Invalid BitField size expression"); - FieldSize = I.getZExtValue(); + FieldSize = + BitWidthExpr->getIntegerConstantExprValue(Context).getZExtValue(); std::pair<uint64_t, unsigned> FieldInfo = Context.getTypeInfo(FD->getType()); |