[Lldb-commits] [lldb] e9f5ca0 - [lldb] Adjust for getIntegerConstantExpression refactor

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 21 23:04:41 PDT 2020


Author: Jonas Devlieghere
Date: 2020-07-21T23:04:22-07:00
New Revision: e9f5ca0b7977bb3886feae0d35617a0ea9349a2a

URL: https://github.com/llvm/llvm-project/commit/e9f5ca0b7977bb3886feae0d35617a0ea9349a2a
DIFF: https://github.com/llvm/llvm-project/commit/e9f5ca0b7977bb3886feae0d35617a0ea9349a2a.diff

LOG: [lldb] Adjust for getIntegerConstantExpression refactor

Added: 
    

Modified: 
    lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 8825b473cd33..af11668dbfb6 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -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;
       }
     }


        


More information about the lldb-commits mailing list