[lldb] Adjust for getIntegerConstantExpression refactor
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 22 Jul 2020 06:04:20 +0000 (23:04 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 22 Jul 2020 06:04:22 +0000 (23:04 -0700)
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

index 8825b47..af11668 100644 (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;
       }
     }