[Lldb-commits] [lldb] r351237 - Replace auto -> llvm::Optional<uint64_t>

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 15 12:33:59 PST 2019


Author: adrian
Date: Tue Jan 15 12:33:58 2019
New Revision: 351237

URL: http://llvm.org/viewvc/llvm-project?rev=351237&view=rev
Log:
Replace auto -> llvm::Optional<uint64_t>

This addresses post-commit feedback for https://reviews.llvm.org/D56688

Modified:
    lldb/trunk/source/API/SBType.cpp
    lldb/trunk/source/Commands/CommandObjectMemory.cpp
    lldb/trunk/source/Core/Value.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Core/ValueObjectMemory.cpp
    lldb/trunk/source/Core/ValueObjectVariable.cpp
    lldb/trunk/source/DataFormatters/TypeFormat.cpp
    lldb/trunk/source/DataFormatters/VectorType.cpp
    lldb/trunk/source/Expression/Materializer.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
    lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
    lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
    lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
    lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
    lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
    lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
    lldb/trunk/source/Plugins/Architecture/Mips/ArchitectureMips.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/CompilerType.cpp
    lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Tue Jan 15 12:33:58 2019
@@ -104,7 +104,8 @@ bool SBType::IsValid() const {
 
 uint64_t SBType::GetByteSize() {
   if (IsValid())
-    if (auto size = m_opaque_sp->GetCompilerType(false).GetByteSize(nullptr))
+    if (llvm::Optional<uint64_t> size =
+            m_opaque_sp->GetCompilerType(false).GetByteSize(nullptr))
       return *size;
   return 0;
 }

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Tue Jan 15 12:33:58 2019
@@ -519,7 +519,7 @@ protected:
         --pointer_count;
       }
 
-      auto size = clang_ast_type.GetByteSize(nullptr);
+      llvm::Optional<uint64_t> size = clang_ast_type.GetByteSize(nullptr);
       if (!size) {
         result.AppendErrorWithFormat(
             "unable to get the byte size of the type '%s'\n",
@@ -642,7 +642,7 @@ protected:
       if (!m_format_options.GetFormatValue().OptionWasSet())
         m_format_options.GetFormatValue().SetCurrentValue(eFormatDefault);
 
-      auto size = clang_ast_type.GetByteSize(nullptr);
+      llvm::Optional<uint64_t> size = clang_ast_type.GetByteSize(nullptr);
       if (!size) {
         result.AppendError("can't get size of type");
         return false;
@@ -1064,7 +1064,8 @@ protected:
                m_memory_options.m_expr.GetStringValue(), frame, result_sp)) &&
           result_sp) {
         uint64_t value = result_sp->GetValueAsUnsigned(0);
-        auto size = result_sp->GetCompilerType().GetByteSize(nullptr);
+        llvm::Optional<uint64_t> size =
+            result_sp->GetCompilerType().GetByteSize(nullptr);
         if (!size)
           return false;
         switch (*size) {

Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Tue Jan 15 12:33:58 2019
@@ -224,7 +224,7 @@ uint64_t Value::GetValueByteSize(Status
   {
     const CompilerType &ast_type = GetCompilerType();
     if (ast_type.IsValid())
-      if (auto size = ast_type.GetByteSize(
+      if (llvm::Optional<uint64_t> size = ast_type.GetByteSize(
               exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr))
         byte_size = *size;
   } break;
@@ -346,7 +346,7 @@ Status Value::GetValueAsData(ExecutionCo
     uint32_t limit_byte_size = UINT32_MAX;
 
     if (ast_type.IsValid()) {
-      if (auto size = ast_type.GetByteSize(
+      if (llvm::Optional<uint64_t> size = ast_type.GetByteSize(
               exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr))
         limit_byte_size = *size;
     }

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Jan 15 12:33:58 2019
@@ -756,8 +756,9 @@ size_t ValueObject::GetPointeeData(DataE
 
   ExecutionContext exe_ctx(GetExecutionContextRef());
 
-  auto item_type_size = pointee_or_element_compiler_type.GetByteSize(
-      exe_ctx.GetBestExecutionContextScope());
+  llvm::Optional<uint64_t> item_type_size =
+      pointee_or_element_compiler_type.GetByteSize(
+          exe_ctx.GetBestExecutionContextScope());
   if (!item_type_size)
     return 0;
   const uint64_t bytes = item_count * *item_type_size;
@@ -1823,7 +1824,8 @@ ValueObjectSP ValueObject::GetSyntheticC
     return {};
 
   ExecutionContext exe_ctx(GetExecutionContextRef());
-  auto size = type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
+  llvm::Optional<uint64_t> size =
+      type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
   if (!size)
     return {};
   ValueObjectChild *synthetic_child =
@@ -1864,7 +1866,8 @@ ValueObjectSP ValueObject::GetSyntheticB
   const bool is_base_class = true;
 
   ExecutionContext exe_ctx(GetExecutionContextRef());
-  auto size = type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
+  llvm::Optional<uint64_t> size =
+      type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
   if (!size)
     return {};
   ValueObjectChild *synthetic_child =

Modified: lldb/trunk/source/Core/ValueObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectMemory.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectMemory.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectMemory.cpp Tue Jan 15 12:33:58 2019
@@ -138,7 +138,7 @@ size_t ValueObjectMemory::CalculateNumCh
 uint64_t ValueObjectMemory::GetByteSize() {
   if (m_type_sp)
     return m_type_sp->GetByteSize();
-  if (auto size = m_compiler_type.GetByteSize(nullptr))
+  if (llvm::Optional<uint64_t> size = m_compiler_type.GetByteSize(nullptr))
     return *size;
   return 0;
 }

Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectVariable.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectVariable.cpp Tue Jan 15 12:33:58 2019
@@ -112,7 +112,8 @@ uint64_t ValueObjectVariable::GetByteSiz
   if (!type.IsValid())
     return 0;
 
-  auto size = type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
+  llvm::Optional<uint64_t> size =
+      type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
   return size ? *size : 0;
 }
 

Modified: lldb/trunk/source/DataFormatters/TypeFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeFormat.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/TypeFormat.cpp (original)
+++ lldb/trunk/source/DataFormatters/TypeFormat.cpp Tue Jan 15 12:33:58 2019
@@ -96,7 +96,7 @@ bool TypeFormatImpl_Format::FormatObject
 
         ExecutionContextScope *exe_scope =
             exe_ctx.GetBestExecutionContextScope();
-        auto size = compiler_type.GetByteSize(exe_scope);
+        llvm::Optional<uint64_t> size = compiler_type.GetByteSize(exe_scope);
         if (!size)
           return false;
         StreamString sstr;

Modified: lldb/trunk/source/DataFormatters/VectorType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/VectorType.cpp (original)
+++ lldb/trunk/source/DataFormatters/VectorType.cpp Tue Jan 15 12:33:58 2019
@@ -171,8 +171,9 @@ static size_t CalculateNumChildren(
     lldb_private::ExecutionContextScope *exe_scope =
         nullptr // does not matter here because all we trade in are basic types
     ) {
-  auto container_size = container_type.GetByteSize(exe_scope);
-  auto element_size = element_type.GetByteSize(exe_scope);
+  llvm::Optional<uint64_t> container_size =
+      container_type.GetByteSize(exe_scope);
+  llvm::Optional<uint64_t> element_size = element_type.GetByteSize(exe_scope);
 
   if (container_size && element_size && *element_size) {
     if (*container_size % *element_size)
@@ -198,7 +199,7 @@ public:
   lldb::ValueObjectSP GetChildAtIndex(size_t idx) override {
     if (idx >= CalculateNumChildren())
       return {};
-    auto size = m_child_type.GetByteSize(nullptr);
+    llvm::Optional<uint64_t> size = m_child_type.GetByteSize(nullptr);
     if (!size)
       return {};
     auto offset = idx * *size;

Modified: lldb/trunk/source/Expression/Materializer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Tue Jan 15 12:33:58 2019
@@ -46,7 +46,7 @@ uint32_t Materializer::AddStructMember(E
 }
 
 void Materializer::Entity::SetSizeAndAlignmentFromType(CompilerType &type) {
-  if (auto size = type.GetByteSize(nullptr))
+  if (llvm::Optional<uint64_t> size = type.GetByteSize(nullptr))
     m_size = *size;
 
   uint32_t bit_alignment = type.GetTypeBitAlign();
@@ -795,7 +795,7 @@ public:
 
       ExecutionContextScope *exe_scope = map.GetBestExecutionContextScope();
 
-      auto byte_size = m_type.GetByteSize(exe_scope);
+      llvm::Optional<uint64_t> byte_size = m_type.GetByteSize(exe_scope);
       if (!byte_size) {
         err.SetErrorString("can't get size of type");
         return;

Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp Tue Jan 15 12:33:58 2019
@@ -1470,7 +1470,7 @@ bool ABIMacOSX_arm::GetArgumentValues(Th
     if (compiler_type) {
       bool is_signed = false;
       size_t bit_width = 0;
-      auto bit_size = compiler_type.GetBitSize(&thread);
+      llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
       if (!bit_size)
         return false;
       if (compiler_type.IsIntegerOrEnumerationType(is_signed))
@@ -1576,7 +1576,7 @@ ValueObjectSP ABIMacOSX_arm::GetReturnVa
 
   const RegisterInfo *r0_reg_info = reg_ctx->GetRegisterInfoByName("r0", 0);
   if (compiler_type.IsIntegerOrEnumerationType(is_signed)) {
-    auto bit_width = compiler_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_width = compiler_type.GetBitSize(&thread);
     if (!bit_width)
       return return_valobj_sp;
 
@@ -1596,7 +1596,8 @@ ValueObjectSP ABIMacOSX_arm::GetReturnVa
           const RegisterInfo *r3_reg_info =
               reg_ctx->GetRegisterInfoByName("r3", 0);
           if (r1_reg_info && r2_reg_info && r3_reg_info) {
-            auto byte_size = compiler_type.GetByteSize(&thread);
+            llvm::Optional<uint64_t> byte_size =
+                compiler_type.GetByteSize(&thread);
             if (!byte_size)
               return return_valobj_sp;
             ProcessSP process_sp(thread.GetProcess());

Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp Tue Jan 15 12:33:58 2019
@@ -1762,7 +1762,7 @@ bool ABIMacOSX_arm64::GetArgumentValues(
       return false;
 
     CompilerType value_type = value->GetCompilerType();
-    auto bit_size = value_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_size = value_type.GetBitSize(&thread);
     if (!bit_size)
       return false;
 
@@ -2111,7 +2111,7 @@ static bool LoadValueFromConsecutiveGPRR
     uint32_t &NGRN,       // NGRN (see ABI documentation)
     uint32_t &NSRN,       // NSRN (see ABI documentation)
     DataExtractor &data) {
-  auto byte_size = value_type.GetByteSize(nullptr);
+  llvm::Optional<uint64_t> byte_size = value_type.GetByteSize(nullptr);
   if (!byte_size || *byte_size == 0)
     return false;
 
@@ -2128,7 +2128,7 @@ static bool LoadValueFromConsecutiveGPRR
     if (NSRN < 8 && (8 - NSRN) >= homogeneous_count) {
       if (!base_type)
         return false;
-      auto base_byte_size = base_type.GetByteSize(nullptr);
+      llvm::Optional<uint64_t> base_byte_size = base_type.GetByteSize(nullptr);
       if (!base_byte_size)
         return false;
       uint32_t data_offset = 0;
@@ -2264,7 +2264,8 @@ ValueObjectSP ABIMacOSX_arm64::GetReturn
   if (!reg_ctx)
     return return_valobj_sp;
 
-  auto byte_size = return_compiler_type.GetByteSize(nullptr);
+  llvm::Optional<uint64_t> byte_size =
+      return_compiler_type.GetByteSize(nullptr);
   if (!byte_size)
     return return_valobj_sp;
 

Modified: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Tue Jan 15 12:33:58 2019
@@ -824,7 +824,7 @@ bool ABIMacOSX_i386::GetArgumentValues(T
     // We currently only support extracting values with Clang QualTypes. Do we
     // care about others?
     CompilerType compiler_type(value->GetCompilerType());
-    auto bit_size = compiler_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
     if (bit_size) {
       bool is_signed;
       if (compiler_type.IsIntegerOrEnumerationType(is_signed))
@@ -933,7 +933,7 @@ ABIMacOSX_i386::GetReturnValueObjectImpl
   bool is_signed;
 
   if (compiler_type.IsIntegerOrEnumerationType(is_signed)) {
-    auto bit_width = compiler_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_width = compiler_type.GetBitSize(&thread);
     if (!bit_width)
       return return_valobj_sp;
     unsigned eax_id =

Modified: lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp Tue Jan 15 12:33:58 2019
@@ -1473,7 +1473,7 @@ bool ABISysV_arm::GetArgumentValues(Thre
       size_t bit_width = 0;
       if (compiler_type.IsIntegerOrEnumerationType(is_signed) ||
           compiler_type.IsPointerOrReferenceType()) {
-        if (auto size = compiler_type.GetBitSize(&thread))
+        if (llvm::Optional<uint64_t> size = compiler_type.GetBitSize(&thread))
           bit_width = *size;
       } else {
         // We only handle integer, pointer and reference types currently...
@@ -1580,8 +1580,8 @@ ValueObjectSP ABISysV_arm::GetReturnValu
 
   const RegisterInfo *r0_reg_info =
       reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1);
-  auto bit_width = compiler_type.GetBitSize(&thread);
-  auto byte_size = compiler_type.GetByteSize(&thread);
+  llvm::Optional<uint64_t> bit_width = compiler_type.GetBitSize(&thread);
+  llvm::Optional<uint64_t> byte_size = compiler_type.GetByteSize(&thread);
   if (!bit_width || !byte_size)
     return return_valobj_sp;
 
@@ -1717,7 +1717,8 @@ ValueObjectSP ABISysV_arm::GetReturnValu
           compiler_type.IsHomogeneousAggregate(&base_type);
 
       if (homogeneous_count > 0 && homogeneous_count <= 4) {
-        auto base_byte_size = base_type.GetByteSize(nullptr);
+        llvm::Optional<uint64_t> base_byte_size =
+            base_type.GetByteSize(nullptr);
         if (base_type.IsVectorType(nullptr, nullptr)) {
           if (base_byte_size &&
               (*base_byte_size == 8 || *base_byte_size == 16)) {
@@ -1745,7 +1746,8 @@ ValueObjectSP ABISysV_arm::GetReturnValu
                 compiler_type.GetFieldAtIndex(index, name, NULL, NULL, NULL);
 
             if (base_type.IsFloatingPointType(float_count, is_complex)) {
-              auto base_byte_size = base_type.GetByteSize(nullptr);
+              llvm::Optional<uint64_t> base_byte_size =
+                  base_type.GetByteSize(nullptr);
               if (float_count == 2 && is_complex) {
                 if (index != 0 && base_byte_size &&
                     vfp_byte_size != *base_byte_size)

Modified: lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp Tue Jan 15 12:33:58 2019
@@ -1767,7 +1767,7 @@ bool ABISysV_arm64::GetArgumentValues(Th
     if (value_type) {
       bool is_signed = false;
       size_t bit_width = 0;
-      auto bit_size = value_type.GetBitSize(&thread);
+      llvm::Optional<uint64_t> bit_size = value_type.GetBitSize(&thread);
       if (!bit_size)
         return false;
       if (value_type.IsIntegerOrEnumerationType(is_signed)) {
@@ -2086,7 +2086,7 @@ static bool LoadValueFromConsecutiveGPRR
     uint32_t &NGRN,       // NGRN (see ABI documentation)
     uint32_t &NSRN,       // NSRN (see ABI documentation)
     DataExtractor &data) {
-  auto byte_size = value_type.GetByteSize(nullptr);
+  llvm::Optional<uint64_t> byte_size = value_type.GetByteSize(nullptr);
 
   if (byte_size || *byte_size == 0)
     return false;
@@ -2104,7 +2104,7 @@ static bool LoadValueFromConsecutiveGPRR
     if (NSRN < 8 && (8 - NSRN) >= homogeneous_count) {
       if (!base_type)
         return false;
-      auto base_byte_size = base_type.GetByteSize(nullptr);
+      llvm::Optional<uint64_t> base_byte_size = base_type.GetByteSize(nullptr);
       if (!base_byte_size)
         return false;
       uint32_t data_offset = 0;
@@ -2233,7 +2233,8 @@ ValueObjectSP ABISysV_arm64::GetReturnVa
   if (!reg_ctx)
     return return_valobj_sp;
 
-  auto byte_size = return_compiler_type.GetByteSize(nullptr);
+  llvm::Optional<uint64_t> byte_size =
+      return_compiler_type.GetByteSize(nullptr);
   if (!byte_size)
     return return_valobj_sp;
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp Tue Jan 15 12:33:58 2019
@@ -308,7 +308,7 @@ bool ABISysV_i386::GetArgumentValues(Thr
 
     // Currently: Support for extracting values with Clang QualTypes only.
     CompilerType compiler_type(value->GetCompilerType());
-    auto bit_size = compiler_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
     if (bit_size) {
       bool is_signed;
       if (compiler_type.IsIntegerOrEnumerationType(is_signed)) {
@@ -513,7 +513,8 @@ ValueObjectSP ABISysV_i386::GetReturnVal
              (type_flags & eTypeIsEnumeration)) //'Integral' + 'Floating Point'
   {
     value.SetValueType(Value::eValueTypeScalar);
-    auto byte_size = return_compiler_type.GetByteSize(nullptr);
+    llvm::Optional<uint64_t> byte_size =
+        return_compiler_type.GetByteSize(nullptr);
     if (!byte_size)
       return return_valobj_sp;
     bool success = false;
@@ -637,7 +638,8 @@ ValueObjectSP ABISysV_i386::GetReturnVal
     // ToDo: Yet to be implemented
   } else if (type_flags & eTypeIsVector) // 'Packed'
   {
-    auto byte_size = return_compiler_type.GetByteSize(nullptr);
+    llvm::Optional<uint64_t> byte_size =
+        return_compiler_type.GetByteSize(nullptr);
     if (byte_size && *byte_size > 0) {
       const RegisterInfo *vec_reg = reg_ctx->GetRegisterInfoByName("xmm0", 0);
       if (vec_reg == nullptr)

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Tue Jan 15 12:33:58 2019
@@ -812,7 +812,7 @@ ValueObjectSP ABISysV_mips::GetReturnVal
 
   // In MIPS register "r2" (v0) holds the integer function return values
   const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoByName("r2", 0);
-  auto bit_width = return_compiler_type.GetBitSize(&thread);
+  llvm::Optional<uint64_t> bit_width = return_compiler_type.GetBitSize(&thread);
   if (!bit_width)
     return return_valobj_sp;
   if (return_compiler_type.IsIntegerOrEnumerationType(is_signed)) {

Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Tue Jan 15 12:33:58 2019
@@ -762,7 +762,8 @@ ValueObjectSP ABISysV_mips64::GetReturnV
   Target *target = exe_ctx.GetTargetPtr();
   const ArchSpec target_arch = target->GetArchitecture();
   ByteOrder target_byte_order = target_arch.GetByteOrder();
-  auto byte_size = return_compiler_type.GetByteSize(nullptr);
+  llvm::Optional<uint64_t> byte_size =
+      return_compiler_type.GetByteSize(nullptr);
   if (!byte_size)
     return return_valobj_sp;
   const uint32_t type_flags = return_compiler_type.GetTypeInfo(nullptr);
@@ -970,7 +971,8 @@ ValueObjectSP ABISysV_mips64::GetReturnV
             CompilerType field_compiler_type =
                 return_compiler_type.GetFieldAtIndex(
                     idx, name, &field_bit_offset, nullptr, nullptr);
-            auto field_byte_width = field_compiler_type.GetByteSize(nullptr);
+            llvm::Optional<uint64_t> field_byte_width =
+                field_compiler_type.GetByteSize(nullptr);
             if (!field_byte_width)
               return return_valobj_sp;
 
@@ -1041,7 +1043,8 @@ ValueObjectSP ABISysV_mips64::GetReturnV
 
         CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
             idx, name, &field_bit_offset, nullptr, nullptr);
-        auto field_byte_width = field_compiler_type.GetByteSize(nullptr);
+        llvm::Optional<uint64_t> field_byte_width =
+            field_compiler_type.GetByteSize(nullptr);
 
         // if we don't know the size of the field (e.g. invalid type), just
         // bail out

Modified: lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp Tue Jan 15 12:33:58 2019
@@ -398,7 +398,7 @@ bool ABISysV_ppc::GetArgumentValues(Thre
     // We currently only support extracting values with Clang QualTypes. Do we
     // care about others?
     CompilerType compiler_type = value->GetCompilerType();
-    auto bit_size = compiler_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
     if (!bit_size)
       return false;
     bool is_signed;
@@ -466,7 +466,8 @@ Status ABISysV_ppc::SetReturnValueObject
       error.SetErrorString(
           "We don't support returning complex values at present");
     else {
-      auto bit_width = compiler_type.GetBitSize(frame_sp.get());
+      llvm::Optional<uint64_t> bit_width =
+          compiler_type.GetBitSize(frame_sp.get());
       if (!bit_width) {
         error.SetErrorString("can't get type size");
         return error;
@@ -529,7 +530,8 @@ ValueObjectSP ABISysV_ppc::GetReturnValu
     if (type_flags & eTypeIsInteger) {
       // Extract the register context so we can read arguments from registers
 
-      auto byte_size = return_compiler_type.GetByteSize(nullptr);
+      llvm::Optional<uint64_t> byte_size =
+          return_compiler_type.GetByteSize(nullptr);
       if (!byte_size)
         return return_valobj_sp;
       uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
@@ -575,7 +577,8 @@ ValueObjectSP ABISysV_ppc::GetReturnValu
       if (type_flags & eTypeIsComplex) {
         // Don't handle complex yet.
       } else {
-        auto byte_size = return_compiler_type.GetByteSize(nullptr);
+        llvm::Optional<uint64_t> byte_size =
+            return_compiler_type.GetByteSize(nullptr);
         if (byte_size && *byte_size <= sizeof(long double)) {
           const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
           RegisterValue f1_value;
@@ -608,7 +611,8 @@ ValueObjectSP ABISysV_ppc::GetReturnValu
     return_valobj_sp = ValueObjectConstResult::Create(
         thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
   } else if (type_flags & eTypeIsVector) {
-    auto byte_size = return_compiler_type.GetByteSize(nullptr);
+    llvm::Optional<uint64_t> byte_size =
+        return_compiler_type.GetByteSize(nullptr);
     if (byte_size && *byte_size > 0) {
       const RegisterInfo *altivec_reg = reg_ctx->GetRegisterInfoByName("v2", 0);
       if (altivec_reg) {
@@ -658,7 +662,7 @@ ValueObjectSP ABISysV_ppc::GetReturnValu
   if (!reg_ctx_sp)
     return return_valobj_sp;
 
-  auto bit_width = return_compiler_type.GetBitSize(&thread);
+  llvm::Optional<uint64_t> bit_width = return_compiler_type.GetBitSize(&thread);
   if (!bit_width)
     return return_valobj_sp;
   if (return_compiler_type.IsAggregateType()) {
@@ -702,7 +706,8 @@ ValueObjectSP ABISysV_ppc::GetReturnValu
 
         CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
             idx, name, &field_bit_offset, nullptr, nullptr);
-        auto field_bit_width = field_compiler_type.GetBitSize(&thread);
+        llvm::Optional<uint64_t> field_bit_width =
+            field_compiler_type.GetBitSize(&thread);
         if (!field_bit_width)
           return return_valobj_sp;
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp Tue Jan 15 12:33:58 2019
@@ -280,7 +280,7 @@ bool ABISysV_ppc64::GetArgumentValues(Th
     // We currently only support extracting values with Clang QualTypes. Do we
     // care about others?
     CompilerType compiler_type = value->GetCompilerType();
-    auto bit_size = compiler_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
     if (!bit_size)
       return false;
     bool is_signed;
@@ -350,7 +350,8 @@ Status ABISysV_ppc64::SetReturnValueObje
       error.SetErrorString(
           "We don't support returning complex values at present");
     else {
-      auto bit_width = compiler_type.GetBitSize(frame_sp.get());
+      llvm::Optional<uint64_t> bit_width =
+          compiler_type.GetBitSize(frame_sp.get());
       if (!bit_width) {
         error.SetErrorString("can't get size of type");
         return error;
@@ -653,7 +654,7 @@ private:
     DataExtractor de(&raw_data, sizeof(raw_data), m_byte_order, m_addr_size);
 
     offset_t offset = 0;
-    auto byte_size = type.GetByteSize(nullptr);
+    llvm::Optional<uint64_t> byte_size = type.GetByteSize(nullptr);
     if (!byte_size)
       return {};
     switch (*byte_size) {
@@ -787,7 +788,7 @@ private:
     CompilerType elem_type;
     if (m_type.IsHomogeneousAggregate(&elem_type)) {
       uint32_t type_flags = elem_type.GetTypeInfo();
-      auto elem_size = elem_type.GetByteSize(nullptr);
+      llvm::Optional<uint64_t> elem_size = elem_type.GetByteSize(nullptr);
       if (!elem_size)
         return {};
       if (type_flags & eTypeIsComplex || !(type_flags & eTypeIsFloat)) {

Modified: lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp Tue Jan 15 12:33:58 2019
@@ -376,7 +376,7 @@ bool ABISysV_s390x::GetArgumentValues(Th
     // We currently only support extracting values with Clang QualTypes. Do we
     // care about others?
     CompilerType compiler_type = value->GetCompilerType();
-    auto bit_size = compiler_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
     if (!bit_size)
       return false;
     bool is_signed;
@@ -446,7 +446,8 @@ Status ABISysV_s390x::SetReturnValueObje
       error.SetErrorString(
           "We don't support returning complex values at present");
     else {
-      auto bit_width = compiler_type.GetBitSize(frame_sp.get());
+      llvm::Optional<uint64_t> bit_width =
+          compiler_type.GetBitSize(frame_sp.get());
       if (!bit_width) {
         error.SetErrorString("can't get type size");
         return error;
@@ -511,9 +512,9 @@ ValueObjectSP ABISysV_s390x::GetReturnVa
 
     bool success = false;
     if (type_flags & eTypeIsInteger) {
-      // Extract the register context so we can read arguments from registers
-
-      auto byte_size = return_compiler_type.GetByteSize(nullptr);
+      // Extract the register context so we can read arguments from registers.
+      llvm::Optional<uint64_t> byte_size =
+          return_compiler_type.GetByteSize(nullptr);
       if (!byte_size)
         return return_valobj_sp;
       uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
@@ -559,7 +560,8 @@ ValueObjectSP ABISysV_s390x::GetReturnVa
       if (type_flags & eTypeIsComplex) {
         // Don't handle complex yet.
       } else {
-        auto byte_size = return_compiler_type.GetByteSize(nullptr);
+        llvm::Optional<uint64_t> byte_size =
+            return_compiler_type.GetByteSize(nullptr);
         if (byte_size && *byte_size <= sizeof(long double)) {
           const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
           RegisterValue f0_value;

Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Tue Jan 15 12:33:58 2019
@@ -1263,7 +1263,7 @@ bool ABISysV_x86_64::GetArgumentValues(T
     // We currently only support extracting values with Clang QualTypes. Do we
     // care about others?
     CompilerType compiler_type = value->GetCompilerType();
-    auto bit_size = compiler_type.GetBitSize(&thread);
+    llvm::Optional<uint64_t> bit_size = compiler_type.GetBitSize(&thread);
     if (!bit_size)
       return false;
     bool is_signed;
@@ -1333,7 +1333,8 @@ Status ABISysV_x86_64::SetReturnValueObj
       error.SetErrorString(
           "We don't support returning complex values at present");
     else {
-      auto bit_width = compiler_type.GetBitSize(frame_sp.get());
+      llvm::Optional<uint64_t> bit_width =
+          compiler_type.GetBitSize(frame_sp.get());
       if (!bit_width) {
         error.SetErrorString("can't get type size");
         return error;
@@ -1401,7 +1402,8 @@ ValueObjectSP ABISysV_x86_64::GetReturnV
     if (type_flags & eTypeIsInteger) {
       // Extract the register context so we can read arguments from registers
 
-      auto byte_size = return_compiler_type.GetByteSize(nullptr);
+      llvm::Optional<uint64_t> byte_size =
+          return_compiler_type.GetByteSize(nullptr);
       if (!byte_size)
         return return_valobj_sp;
       uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
@@ -1447,7 +1449,8 @@ ValueObjectSP ABISysV_x86_64::GetReturnV
       if (type_flags & eTypeIsComplex) {
         // Don't handle complex yet.
       } else {
-        auto byte_size = return_compiler_type.GetByteSize(nullptr);
+        llvm::Optional<uint64_t> byte_size =
+            return_compiler_type.GetByteSize(nullptr);
         if (byte_size && *byte_size <= sizeof(long double)) {
           const RegisterInfo *xmm0_info =
               reg_ctx->GetRegisterInfoByName("xmm0", 0);
@@ -1485,7 +1488,8 @@ ValueObjectSP ABISysV_x86_64::GetReturnV
     return_valobj_sp = ValueObjectConstResult::Create(
         thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
   } else if (type_flags & eTypeIsVector) {
-    auto byte_size = return_compiler_type.GetByteSize(nullptr);
+    llvm::Optional<uint64_t> byte_size =
+        return_compiler_type.GetByteSize(nullptr);
     if (byte_size && *byte_size > 0) {
       const RegisterInfo *altivec_reg =
           reg_ctx->GetRegisterInfoByName("xmm0", 0);
@@ -1571,7 +1575,7 @@ ValueObjectSP ABISysV_x86_64::GetReturnV
   if (!reg_ctx_sp)
     return return_valobj_sp;
 
-  auto bit_width = return_compiler_type.GetBitSize(&thread);
+  llvm::Optional<uint64_t> bit_width = return_compiler_type.GetBitSize(&thread);
   if (!bit_width)
     return return_valobj_sp;
   if (return_compiler_type.IsAggregateType()) {
@@ -1624,7 +1628,8 @@ ValueObjectSP ABISysV_x86_64::GetReturnV
 
         CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
             idx, name, &field_bit_offset, nullptr, nullptr);
-        auto field_bit_width = field_compiler_type.GetBitSize(&thread);
+        llvm::Optional<uint64_t> field_bit_width =
+            field_compiler_type.GetBitSize(&thread);
 
         // if we don't know the size of the field (e.g. invalid type), just
         // bail out

Modified: lldb/trunk/source/Plugins/Architecture/Mips/ArchitectureMips.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Architecture/Mips/ArchitectureMips.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Architecture/Mips/ArchitectureMips.cpp (original)
+++ lldb/trunk/source/Plugins/Architecture/Mips/ArchitectureMips.cpp Tue Jan 15 12:33:58 2019
@@ -127,7 +127,7 @@ lldb::addr_t ArchitectureMips::GetBreaka
     return addr;
 
   // Adjust the breakable address
-  auto breakable_addr = addr - insn->GetOpcode().GetByteSize();
+  uint64_t breakable_addr = addr - insn->GetOpcode().GetByteSize();
   if (log)
     log->Printf("Target::%s Breakpoint at 0x%8.8" PRIx64
       " is adjusted to 0x%8.8" PRIx64 " due to delay slot\n",

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Tue Jan 15 12:33:58 2019
@@ -310,7 +310,7 @@ bool IRForTarget::CreateResultVariable(l
 
   lldb::TargetSP target_sp(m_execution_unit.GetTarget());
   lldb_private::ExecutionContext exe_ctx(target_sp, true);
-  auto bit_size =
+  llvm::Optional<uint64_t> bit_size =
       m_result_type.GetBitSize(exe_ctx.GetBestExecutionContextScope());
   if (!bit_size) {
     lldb_private::StreamString type_desc_stream;
@@ -1372,7 +1372,7 @@ bool IRForTarget::MaybeHandleVariable(Va
       value_type = global_variable->getType();
     }
 
-    auto value_size = compiler_type.GetByteSize(nullptr);
+    llvm::Optional<uint64_t> value_size = compiler_type.GetByteSize(nullptr);
     if (!value_size)
       return false;
     lldb::offset_t value_alignment =

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp Tue Jan 15 12:33:58 2019
@@ -101,7 +101,7 @@ bool lldb_private::formatters::WCharStri
     return false;
 
   // Safe to pass nullptr for exe_scope here.
-  auto size = wchar_compiler_type.GetBitSize(nullptr);
+  llvm::Optional<uint64_t> size = wchar_compiler_type.GetBitSize(nullptr);
   if (!size)
     return false;
   const uint32_t wchar_size = *size;
@@ -198,7 +198,7 @@ bool lldb_private::formatters::WCharSumm
     return false;
 
     // Safe to pass nullptr for exe_scope here.
-  auto size = wchar_compiler_type.GetBitSize(nullptr);
+  llvm::Optional<uint64_t> size = wchar_compiler_type.GetBitSize(nullptr);
   if (!size)
     return false;
   const uint32_t wchar_size = *size;

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp Tue Jan 15 12:33:58 2019
@@ -255,7 +255,7 @@ bool lldb_private::formatters::LibCxxMap
               ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType()},
              {"cw", ast_ctx->GetBasicType(lldb::eBasicTypeBool)},
              {"payload", pair_type}});
-        auto size = tree_node_type.GetByteSize(nullptr);
+        llvm::Optional<uint64_t> size = tree_node_type.GetByteSize(nullptr);
         if (!size)
           return false;
         DataBufferSP buffer_sp(new DataBufferHeap(*size, 0));

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp Tue Jan 15 12:33:58 2019
@@ -80,7 +80,8 @@ ValueObjectSP BitsetFrontEnd::GetChildAt
   ValueObjectSP chunk;
   // For small bitsets __first_ is not an array, but a plain size_t.
   if (m_first->GetCompilerType().IsArrayType(&type, nullptr, nullptr)) {
-    auto bit_size = type.GetBitSize(ctx.GetBestExecutionContextScope());
+    llvm::Optional<uint64_t> bit_size =
+        type.GetBitSize(ctx.GetBestExecutionContextScope());
     if (!bit_size || *bit_size == 0)
       return {};
     chunk = m_first->GetChildAtIndex(idx / *bit_size, true);
@@ -91,7 +92,8 @@ ValueObjectSP BitsetFrontEnd::GetChildAt
   if (!type || !chunk)
     return {};
 
-  auto bit_size = type.GetBitSize(ctx.GetBestExecutionContextScope());
+  llvm::Optional<uint64_t> bit_size =
+      type.GetBitSize(ctx.GetBestExecutionContextScope());
   if (!bit_size || *bit_size == 0)
     return {};
   size_t chunk_idx = idx % *bit_size;

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp Tue Jan 15 12:33:58 2019
@@ -94,7 +94,7 @@ bool lldb_private::formatters::LibcxxIni
   if (!m_element_type.IsValid())
     return false;
 
-  if (auto size = m_element_type.GetByteSize(nullptr)) {
+  if (llvm::Optional<uint64_t> size = m_element_type.GetByteSize(nullptr)) {
     m_element_size = *size;
     // Store raw pointers or end up with a circular dependency.
     m_start = m_backend.GetChildMemberWithName(g___begin_, true).get();

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp Tue Jan 15 12:33:58 2019
@@ -145,7 +145,7 @@ bool lldb_private::formatters::LibcxxStd
   if (!data_type_finder_sp)
     return false;
   m_element_type = data_type_finder_sp->GetCompilerType().GetPointeeType();
-  if (auto size = m_element_type.GetByteSize(nullptr)) {
+  if (llvm::Optional<uint64_t> size = m_element_type.GetByteSize(nullptr)) {
     m_element_size = *size;
 
     if (m_element_size > 0) {
@@ -213,7 +213,7 @@ lldb_private::formatters::LibcxxVectorBo
     return {};
   mask = 1 << bit_index;
   bool bit_set = ((byte & mask) != 0);
-  auto size = m_bool_type.GetByteSize(nullptr);
+  llvm::Optional<uint64_t> size = m_bool_type.GetByteSize(nullptr);
   if (!size)
     return {};
   DataBufferSP buffer_sp(new DataBufferHeap(*size, 0));

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp Tue Jan 15 12:33:58 2019
@@ -298,7 +298,7 @@ bool lldb_private::formatters::LibStdcpp
         return false;
 
       // Safe to pass nullptr for exe_scope here.
-      auto size = wchar_compiler_type.GetBitSize(nullptr);
+      llvm::Optional<uint64_t> size = wchar_compiler_type.GetBitSize(nullptr);
       if (!size)
         return false;
       const uint32_t wchar_size = *size;

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp Tue Jan 15 12:33:58 2019
@@ -513,7 +513,7 @@ void ClassDescriptorV2::iVarsStorage::fi
     CompilerType ivar_type =
         encoding_to_type_sp->RealizeType(type, for_expression);
     if (ivar_type) {
-      auto ivar_size = ivar_type.GetByteSize(nullptr);
+      llvm::Optional<uint64_t> ivar_size = ivar_type.GetByteSize(nullptr);
       LLDB_LOGV(log,
                 "name = {0}, encoding = {1}, offset_ptr = {2:x}, size = "
                 "{3}, type_size = {4}",

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Tue Jan 15 12:33:58 2019
@@ -1850,7 +1850,8 @@ TypeSP DWARFASTParserClang::ParseTypeFro
           clang_type = ClangASTContext::CreateMemberPointerType(
               class_clang_type, pointee_clang_type);
 
-          if (auto clang_type_size = clang_type.GetByteSize(nullptr)) {
+          if (llvm::Optional<uint64_t> clang_type_size =
+                  clang_type.GetByteSize(nullptr)) {
             byte_size = *clang_type_size;
             type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str,
                                    byte_size, NULL, LLDB_INVALID_UID,
@@ -2046,7 +2047,7 @@ bool DWARFASTParserClang::ParseTemplateD
         clang_type.IsIntegerOrEnumerationType(is_signed);
 
         if (tag == DW_TAG_template_value_parameter && uval64_valid) {
-          auto size = clang_type.GetBitSize(nullptr);
+          llvm::Optional<uint64_t> size = clang_type.GetBitSize(nullptr);
           if (!size)
             return false;
           llvm::APInt apint(*size, uval64, is_signed);

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Jan 15 12:33:58 2019
@@ -4506,7 +4506,7 @@ ClangASTContext::GetArrayElementType(lld
 
     // TODO: the real stride will be >= this value.. find the real one!
     if (stride)
-      if (auto size = element_type.GetByteSize(nullptr))
+      if (llvm::Optional<uint64_t> size = element_type.GetByteSize(nullptr))
         *stride = *size;
 
     return element_type;
@@ -6684,7 +6684,7 @@ CompilerType ClangASTContext::GetChildCo
             CompilerType base_class_clang_type(getASTContext(),
                                                base_class->getType());
             child_name = base_class_clang_type.GetTypeName().AsCString("");
-            auto size = base_class_clang_type.GetBitSize(
+            llvm::Optional<uint64_t> size = base_class_clang_type.GetBitSize(
                 exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL);
             if (!size)
               return {};
@@ -6716,7 +6716,7 @@ CompilerType ClangASTContext::GetChildCo
           // alignment (field_type_info.second) from the AST context.
           CompilerType field_clang_type(getASTContext(), field->getType());
           assert(field_idx < record_layout.getFieldCount());
-          auto size = field_clang_type.GetByteSize(
+          llvm::Optional<uint64_t> size = field_clang_type.GetByteSize(
               exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL);
           if (!size)
             return {};
@@ -6891,7 +6891,7 @@ CompilerType ClangASTContext::GetChildCo
 
         // We have a pointer to an simple type
         if (idx == 0 && pointee_clang_type.GetCompleteType()) {
-          if (auto size = pointee_clang_type.GetByteSize(
+          if (llvm::Optional<uint64_t> size = pointee_clang_type.GetByteSize(
                   exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL)) {
             child_byte_size = *size;
             child_byte_offset = 0;
@@ -6914,7 +6914,7 @@ CompilerType ClangASTContext::GetChildCo
           ::snprintf(element_name, sizeof(element_name), "[%" PRIu64 "]",
                      static_cast<uint64_t>(idx));
           child_name.assign(element_name);
-          if (auto size = element_type.GetByteSize(
+          if (llvm::Optional<uint64_t> size = element_type.GetByteSize(
                   exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL)) {
             child_byte_size = *size;
             child_byte_offset = (int32_t)idx * (int32_t)child_byte_size;
@@ -6933,7 +6933,7 @@ CompilerType ClangASTContext::GetChildCo
         CompilerType element_type(getASTContext(), array->getElementType());
         if (element_type.GetCompleteType()) {
           child_name = llvm::formatv("[{0}]", idx);
-          if (auto size = element_type.GetByteSize(
+          if (llvm::Optional<uint64_t> size = element_type.GetByteSize(
                   exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL)) {
             child_byte_size = *size;
             child_byte_offset = (int32_t)idx * (int32_t)child_byte_size;
@@ -6972,7 +6972,7 @@ CompilerType ClangASTContext::GetChildCo
 
       // We have a pointer to an simple type
       if (idx == 0) {
-        if (auto size = pointee_clang_type.GetByteSize(
+        if (llvm::Optional<uint64_t> size = pointee_clang_type.GetByteSize(
                 exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL)) {
           child_byte_size = *size;
           child_byte_offset = 0;
@@ -7009,7 +7009,7 @@ CompilerType ClangASTContext::GetChildCo
 
         // We have a pointer to an simple type
         if (idx == 0) {
-          if (auto size = pointee_clang_type.GetByteSize(
+          if (llvm::Optional<uint64_t> size = pointee_clang_type.GetByteSize(
                   exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL)) {
             child_byte_size = *size;
             child_byte_offset = 0;

Modified: lldb/trunk/source/Symbol/CompilerType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompilerType.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/CompilerType.cpp (original)
+++ lldb/trunk/source/Symbol/CompilerType.cpp Tue Jan 15 12:33:58 2019
@@ -513,7 +513,7 @@ CompilerType::GetBitSize(ExecutionContex
 
 llvm::Optional<uint64_t>
 CompilerType::GetByteSize(ExecutionContextScope *exe_scope) const {
-  if (auto bit_size = GetBitSize(exe_scope))
+  if (llvm::Optional<uint64_t> bit_size = GetBitSize(exe_scope))
     return (*bit_size + 7) / 8;
   return {};
 }
@@ -819,7 +819,7 @@ bool CompilerType::GetValueAsScalar(cons
     if (encoding == lldb::eEncodingInvalid || count != 1)
       return false;
 
-    auto byte_size = GetByteSize(nullptr);
+    llvm::Optional<uint64_t> byte_size = GetByteSize(nullptr);
     if (!byte_size)
       return false;
     lldb::offset_t offset = data_byte_offset;
@@ -917,7 +917,7 @@ bool CompilerType::SetValueFromScalar(co
     if (encoding == lldb::eEncodingInvalid || count != 1)
       return false;
 
-    auto bit_width = GetBitSize(nullptr);
+    llvm::Optional<uint64_t> bit_width = GetBitSize(nullptr);
     if (!bit_width)
       return false;
 

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=351237&r1=351236&r2=351237&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Tue Jan 15 12:33:58 2019
@@ -321,7 +321,8 @@ uint64_t Type::GetByteSize() {
       if (encoding_type)
         m_byte_size = encoding_type->GetByteSize();
       if (m_byte_size == 0)
-        if (auto size = GetLayoutCompilerType().GetByteSize(nullptr))
+        if (llvm::Optional<uint64_t> size =
+                GetLayoutCompilerType().GetByteSize(nullptr))
           m_byte_size = *size;
     } break;
 




More information about the lldb-commits mailing list