[lldb] Adjust for getIntegerConstantExpression refactor

This commit is contained in:
Jonas Devlieghere 2020-07-21 23:04:20 -07:00
parent 9bbf0ecff3
commit e9f5ca0b79
1 changed files with 3 additions and 3 deletions

View File

@ -1657,9 +1657,9 @@ bool TypeSystemClang::FieldIsBitfield(FieldDecl *field,
if (field->isBitField()) {
Expr *bit_width_expr = field->getBitWidth();
if (bit_width_expr) {
llvm::APSInt bit_width_apsint;
if (bit_width_expr->isIntegerConstantExpr(bit_width_apsint, ast)) {
bitfield_bit_size = bit_width_apsint.getLimitedValue(UINT32_MAX);
if (Optional<llvm::APSInt> bit_width_apsint =
bit_width_expr->getIntegerConstantExpr(ast)) {
bitfield_bit_size = bit_width_apsint->getLimitedValue(UINT32_MAX);
return true;
}
}