[lldb] Use value_or instead of getValueOr (NFC)

GitOrigin-RevId: aa88161b378ecb49388eefc28abe2926a229bcfc
diff --git a/include/lldb/Symbol/LineTable.h b/include/lldb/Symbol/LineTable.h
index b5121b2..7fca44b 100644
--- a/include/lldb/Symbol/LineTable.h
+++ b/include/lldb/Symbol/LineTable.h
@@ -350,9 +350,9 @@
     if (!line_entry_ptr)
       return best_match;
 
-    const uint32_t line = src_location_spec.GetLine().getValueOr(0);
+    const uint32_t line = src_location_spec.GetLine().value_or(0);
     const uint16_t column =
-        src_location_spec.GetColumn().getValueOr(LLDB_INVALID_COLUMN_NUMBER);
+        src_location_spec.GetColumn().value_or(LLDB_INVALID_COLUMN_NUMBER);
     const bool exact_match = src_location_spec.GetExactMatch();
 
     for (size_t idx = start_idx; idx < count; ++idx) {
diff --git a/source/API/SBModule.cpp b/source/API/SBModule.cpp
index 1454012..c4e876e 100644
--- a/source/API/SBModule.cpp
+++ b/source/API/SBModule.cpp
@@ -617,9 +617,9 @@
   if (num_versions > 0)
     versions[0] = version.empty() ? UINT32_MAX : version.getMajor();
   if (num_versions > 1)
-    versions[1] = version.getMinor().getValueOr(UINT32_MAX);
+    versions[1] = version.getMinor().value_or(UINT32_MAX);
   if (num_versions > 2)
-    versions[2] = version.getSubminor().getValueOr(UINT32_MAX);
+    versions[2] = version.getSubminor().value_or(UINT32_MAX);
   for (uint32_t i = 3; i < num_versions; ++i)
     versions[i] = UINT32_MAX;
   return result;
diff --git a/source/API/SBPlatform.cpp b/source/API/SBPlatform.cpp
index ac767f7..ba18ba6 100644
--- a/source/API/SBPlatform.cpp
+++ b/source/API/SBPlatform.cpp
@@ -424,7 +424,7 @@
 
   PlatformSP platform_sp(GetSP());
   if (platform_sp) {
-    std::string s = platform_sp->GetOSBuildString().getValueOr("");
+    std::string s = platform_sp->GetOSBuildString().value_or("");
     if (!s.empty()) {
       // Const-ify the string so we don't need to worry about the lifetime of
       // the string
@@ -439,7 +439,7 @@
 
   PlatformSP platform_sp(GetSP());
   if (platform_sp) {
-    std::string s = platform_sp->GetOSKernelDescription().getValueOr("");
+    std::string s = platform_sp->GetOSKernelDescription().value_or("");
     if (!s.empty()) {
       // Const-ify the string so we don't need to worry about the lifetime of
       // the string
@@ -473,7 +473,7 @@
   llvm::VersionTuple version;
   if (PlatformSP platform_sp = GetSP())
     version = platform_sp->GetOSVersion();
-  return version.getMinor().getValueOr(UINT32_MAX);
+  return version.getMinor().value_or(UINT32_MAX);
 }
 
 uint32_t SBPlatform::GetOSUpdateVersion() {
@@ -482,7 +482,7 @@
   llvm::VersionTuple version;
   if (PlatformSP platform_sp = GetSP())
     version = platform_sp->GetOSVersion();
-  return version.getSubminor().getValueOr(UINT32_MAX);
+  return version.getSubminor().value_or(UINT32_MAX);
 }
 
 void SBPlatform::SetSDKRoot(const char *sysroot) {
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index c39e00d..f9e0317 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -330,7 +330,7 @@
   ValueLocker locker;
   lldb::ValueObjectSP value_sp(GetSP(locker));
   if (value_sp) {
-    result = value_sp->GetByteSize().getValueOr(0);
+    result = value_sp->GetByteSize().value_or(0);
   }
 
   return result;
diff --git a/source/Breakpoint/BreakpointResolverFileLine.cpp b/source/Breakpoint/BreakpointResolverFileLine.cpp
index 508f1cf..ff04452 100644
--- a/source/Breakpoint/BreakpointResolverFileLine.cpp
+++ b/source/Breakpoint/BreakpointResolverFileLine.cpp
@@ -100,10 +100,10 @@
   options_dict_sp->AddStringItem(GetKey(OptionNames::FileName),
                                  m_location_spec.GetFileSpec().GetPath());
   options_dict_sp->AddIntegerItem(GetKey(OptionNames::LineNumber),
-                                  m_location_spec.GetLine().getValueOr(0));
+                                  m_location_spec.GetLine().value_or(0));
   options_dict_sp->AddIntegerItem(
       GetKey(OptionNames::Column),
-      m_location_spec.GetColumn().getValueOr(LLDB_INVALID_COLUMN_NUMBER));
+      m_location_spec.GetColumn().value_or(LLDB_INVALID_COLUMN_NUMBER));
   options_dict_sp->AddBooleanItem(GetKey(OptionNames::Inlines),
                                   m_location_spec.GetCheckInlines());
   options_dict_sp->AddBooleanItem(GetKey(OptionNames::ExactMatch),
@@ -227,7 +227,7 @@
   // file.  So we go through the match list and pull out the sets that have the
   // same file spec in their line_entry and treat each set separately.
 
-  const uint32_t line = m_location_spec.GetLine().getValueOr(0);
+  const uint32_t line = m_location_spec.GetLine().value_or(0);
   const llvm::Optional<uint16_t> column = m_location_spec.GetColumn();
 
   // We'll create a new SourceLocationSpec that can take into account the
@@ -238,7 +238,7 @@
   if (is_relative)
     search_file_spec.GetDirectory().Clear();
   SourceLocationSpec search_location_spec(
-      search_file_spec, m_location_spec.GetLine().getValueOr(0),
+      search_file_spec, m_location_spec.GetLine().value_or(0),
       m_location_spec.GetColumn(), m_location_spec.GetCheckInlines(),
       m_location_spec.GetExactMatch());
 
@@ -272,7 +272,7 @@
 void BreakpointResolverFileLine::GetDescription(Stream *s) {
   s->Printf("file = '%s', line = %u, ",
             m_location_spec.GetFileSpec().GetPath().c_str(),
-            m_location_spec.GetLine().getValueOr(0));
+            m_location_spec.GetLine().value_or(0));
   auto column = m_location_spec.GetColumn();
   if (column)
     s->Printf("column = %u, ", *column);
diff --git a/source/Commands/CommandObjectFrame.cpp b/source/Commands/CommandObjectFrame.cpp
index 0e6ddfa..5ba28d2 100644
--- a/source/Commands/CommandObjectFrame.cpp
+++ b/source/Commands/CommandObjectFrame.cpp
@@ -146,7 +146,7 @@
       valobj_sp = frame_sp->GuessValueForAddress(m_options.address.getValue());
     } else if (m_options.reg.hasValue()) {
       valobj_sp = frame_sp->GuessValueForRegisterAndOffset(
-          m_options.reg.getValue(), m_options.offset.getValueOr(0));
+          m_options.reg.getValue(), m_options.offset.value_or(0));
     } else {
       StopInfoSP stop_info_sp = thread->GetStopInfo();
       if (!stop_info_sp) {
diff --git a/source/Commands/CommandObjectWatchpoint.cpp b/source/Commands/CommandObjectWatchpoint.cpp
index faeca87..6805ff7 100644
--- a/source/Commands/CommandObjectWatchpoint.cpp
+++ b/source/Commands/CommandObjectWatchpoint.cpp
@@ -929,7 +929,7 @@
         // We're in business.
         // Find out the size of this variable.
         size = m_option_watchpoint.watch_size == 0
-                   ? valobj_sp->GetByteSize().getValueOr(0)
+                   ? valobj_sp->GetByteSize().value_or(0)
                    : m_option_watchpoint.watch_size;
       }
       compiler_type = valobj_sp->GetCompilerType();
diff --git a/source/Core/AddressResolverFileLine.cpp b/source/Core/AddressResolverFileLine.cpp
index 91ee057..8152a57 100644
--- a/source/Core/AddressResolverFileLine.cpp
+++ b/source/Core/AddressResolverFileLine.cpp
@@ -61,7 +61,7 @@
                   line_start.GetFileAddress(),
                   m_src_location_spec.GetFileSpec().GetFilename().AsCString(
                       "<Unknown>"),
-                  m_src_location_spec.GetLine().getValueOr(0));
+                  m_src_location_spec.GetLine().value_or(0));
       }
     }
   }
@@ -76,5 +76,5 @@
   s->Printf(
       "File and line address - file: \"%s\" line: %u",
       m_src_location_spec.GetFileSpec().GetFilename().AsCString("<Unknown>"),
-      m_src_location_spec.GetLine().getValueOr(0));
+      m_src_location_spec.GetLine().value_or(0));
 }
diff --git a/source/Core/SourceLocationSpec.cpp b/source/Core/SourceLocationSpec.cpp
index 610754b..c83d2d8 100644
--- a/source/Core/SourceLocationSpec.cpp
+++ b/source/Core/SourceLocationSpec.cpp
@@ -16,7 +16,7 @@
                                        llvm::Optional<uint16_t> column,
                                        bool check_inlines, bool exact_match)
     : m_declaration(file_spec, line,
-                    column.getValueOr(LLDB_INVALID_COLUMN_NUMBER)),
+                    column.value_or(LLDB_INVALID_COLUMN_NUMBER)),
       m_check_inlines(check_inlines), m_exact_match(exact_match) {}
 
 SourceLocationSpec::operator bool() const { return m_declaration.IsValid(); }
diff --git a/source/Core/ValueObject.cpp b/source/Core/ValueObject.cpp
index 0b99b98..38918e4 100644
--- a/source/Core/ValueObject.cpp
+++ b/source/Core/ValueObject.cpp
@@ -792,7 +792,7 @@
   uint64_t count = 0;
   const Encoding encoding = GetCompilerType().GetEncoding(count);
 
-  const size_t byte_size = GetByteSize().getValueOr(0);
+  const size_t byte_size = GetByteSize().value_or(0);
 
   Value::ValueType value_type = m_value.GetValueType();
 
@@ -1474,7 +1474,7 @@
   uint64_t count = 0;
   const Encoding encoding = GetCompilerType().GetEncoding(count);
 
-  const size_t byte_size = GetByteSize().getValueOr(0);
+  const size_t byte_size = GetByteSize().value_or(0);
 
   Value::ValueType value_type = m_value.GetValueType();
 
@@ -1656,13 +1656,13 @@
       uint32_t bit_field_offset = from;
       if (GetDataExtractor().GetByteOrder() == eByteOrderBig)
         bit_field_offset =
-            GetByteSize().getValueOr(0) * 8 - bit_field_size - bit_field_offset;
+            GetByteSize().value_or(0) * 8 - bit_field_size - bit_field_offset;
       // We haven't made a synthetic array member for INDEX yet, so lets make
       // one and cache it for any future reference.
       ValueObjectChild *synthetic_child = new ValueObjectChild(
-          *this, GetCompilerType(), index_const_str,
-          GetByteSize().getValueOr(0), 0, bit_field_size, bit_field_offset,
-          false, false, eAddressTypeInvalid, 0);
+          *this, GetCompilerType(), index_const_str, GetByteSize().value_or(0),
+          0, bit_field_size, bit_field_offset, false, false,
+          eAddressTypeInvalid, 0);
 
       // Cache the value if we got one back...
       if (synthetic_child) {
diff --git a/source/Expression/Materializer.cpp b/source/Expression/Materializer.cpp
index feabfd4..9ee2d98 100644
--- a/source/Expression/Materializer.cpp
+++ b/source/Expression/Materializer.cpp
@@ -68,7 +68,7 @@
     const bool zero_memory = false;
 
     lldb::addr_t mem = map.Malloc(
-        m_persistent_variable_sp->GetByteSize().getValueOr(0), 8,
+        m_persistent_variable_sp->GetByteSize().value_or(0), 8,
         lldb::ePermissionsReadable | lldb::ePermissionsWritable,
         IRMemoryMap::eAllocationPolicyMirror, zero_memory, allocate_error);
 
@@ -107,7 +107,7 @@
     Status write_error;
 
     map.WriteMemory(mem, m_persistent_variable_sp->GetValueBytes(),
-                    m_persistent_variable_sp->GetByteSize().getValueOr(0),
+                    m_persistent_variable_sp->GetByteSize().value_or(0),
                     write_error);
 
     if (!write_error.Success()) {
@@ -236,7 +236,7 @@
             map.GetBestExecutionContextScope(),
             m_persistent_variable_sp.get()->GetCompilerType(),
             m_persistent_variable_sp->GetName(), location, eAddressTypeLoad,
-            m_persistent_variable_sp->GetByteSize().getValueOr(0));
+            m_persistent_variable_sp->GetByteSize().value_or(0));
 
         if (frame_top != LLDB_INVALID_ADDRESS &&
             frame_bottom != LLDB_INVALID_ADDRESS && location >= frame_bottom &&
@@ -282,7 +282,7 @@
                   m_persistent_variable_sp->GetName().GetCString(),
                   (uint64_t)mem,
                   (unsigned long long)m_persistent_variable_sp->GetByteSize()
-                      .getValueOr(0));
+                      .value_or(0));
 
         // Read the contents of the spare memory area
 
@@ -291,7 +291,8 @@
         Status read_error;
 
         map.ReadMemory(m_persistent_variable_sp->GetValueBytes(), mem,
-                       m_persistent_variable_sp->GetByteSize().getValueOr(0), read_error);
+                       m_persistent_variable_sp->GetByteSize().value_or(0),
+                       read_error);
 
         if (!read_error.Success()) {
           err.SetErrorStringWithFormat(
@@ -372,11 +373,12 @@
       if (!err.Success()) {
         dump_stream.Printf("  <could not be read>\n");
       } else {
-        DataBufferHeap data(
-            m_persistent_variable_sp->GetByteSize().getValueOr(0), 0);
+        DataBufferHeap data(m_persistent_variable_sp->GetByteSize().value_or(0),
+                            0);
 
         map.ReadMemory(data.GetBytes(), target_address,
-                       m_persistent_variable_sp->GetByteSize().getValueOr(0), err);
+                       m_persistent_variable_sp->GetByteSize().value_or(0),
+                       err);
 
         if (!err.Success()) {
           dump_stream.Printf("  <could not be read>\n");
@@ -527,7 +529,7 @@
                 "size of variable %s (%" PRIu64
                 ") is larger than the ValueObject's size (%" PRIu64 ")",
                 m_variable_sp->GetName().AsCString(),
-                m_variable_sp->GetType()->GetByteSize(scope).getValueOr(0),
+                m_variable_sp->GetType()->GetByteSize(scope).value_or(0),
                 data.GetByteSize());
           }
           return;
@@ -624,7 +626,7 @@
       Status extract_error;
 
       map.GetMemoryData(data, m_temporary_allocation,
-                        valobj_sp->GetByteSize().getValueOr(0), extract_error);
+                        valobj_sp->GetByteSize().value_or(0), extract_error);
 
       if (!extract_error.Success()) {
         err.SetErrorStringWithFormat("couldn't get the data for variable %s",
@@ -921,7 +923,7 @@
 
     ret->ValueUpdated();
 
-    const size_t pvar_byte_size = ret->GetByteSize().getValueOr(0);
+    const size_t pvar_byte_size = ret->GetByteSize().value_or(0);
     uint8_t *pvar_data = ret->GetValueBytes();
 
     map.ReadMemory(pvar_data, address, pvar_byte_size, read_error);
diff --git a/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp b/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
index 4ba547f..e6f0308 100644
--- a/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
+++ b/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
@@ -567,7 +567,7 @@
   ReturnValueExtractor(Thread &thread, CompilerType &type,
                        RegisterContext *reg_ctx, ProcessSP process_sp)
       : m_thread(thread), m_type(type),
-        m_byte_size(m_type.GetByteSize(&thread).getValueOr(0)),
+        m_byte_size(m_type.GetByteSize(&thread).value_or(0)),
         m_data_up(new DataBufferHeap(m_byte_size, 0)), m_reg_ctx(reg_ctx),
         m_process_sp(process_sp), m_byte_order(process_sp->GetByteOrder()),
         m_addr_size(
diff --git a/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
index 1cfa2b8..047aa1e 100644
--- a/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
+++ b/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
@@ -323,7 +323,7 @@
 
   LLDB_LOG(log, "Creating a new result global: \"{0}\" with size {1}",
            m_result_name,
-           m_result_type.GetByteSize(target_sp.get()).getValueOr(0));
+           m_result_type.GetByteSize(target_sp.get()).value_or(0));
 
   // Construct a new result global and set up its metadata
 
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
index 9fdddba..438842d 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
@@ -569,7 +569,7 @@
                 "name = {0}, encoding = {1}, offset_ptr = {2:x}, size = "
                 "{3}, type_size = {4}",
                 name, type, offset_ptr, size,
-                ivar_type.GetByteSize(nullptr).getValueOr(0));
+                ivar_type.GetByteSize(nullptr).value_or(0));
       Scalar offset_scalar;
       Status error;
       const int offset_ptr_size = 4;
diff --git a/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
index dbbfb5b..2727450 100644
--- a/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
+++ b/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
@@ -128,7 +128,7 @@
 
   std::string connect_url;
   auto error =
-      MakeConnectURL(g_remote_platform_pid, parsed_url->port.getValueOr(0),
+      MakeConnectURL(g_remote_platform_pid, parsed_url->port.value_or(0),
                      parsed_url->path, connect_url);
 
   if (error.Fail())
@@ -217,7 +217,7 @@
 
   std::string new_connect_url;
   error = MakeConnectURL(s_remote_gdbserver_fake_pid--,
-                         parsed_url->port.getValueOr(0), parsed_url->path,
+                         parsed_url->port.value_or(0), parsed_url->path,
                          new_connect_url);
   if (error.Fail())
     return nullptr;
diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 455b760..d5d6528 100644
--- a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -824,7 +824,7 @@
         FileSpec native_sdk_spec = sdks_spec;
         StreamString native_sdk_name;
         native_sdk_name.Printf("MacOSX%u.%u.sdk", version.getMajor(),
-                               version.getMinor().getValueOr(0));
+                               version.getMinor().value_or(0));
         native_sdk_spec.AppendPathComponent(native_sdk_name.GetString());
 
         if (FileSystem::Instance().Exists(native_sdk_spec)) {
diff --git a/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp b/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp
index 8d37495..ef4c5ae 100644
--- a/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp
+++ b/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp
@@ -20,7 +20,7 @@
 static bool IsTotalBufferLimitReached(ArrayRef<cpu_id_t> cores,
                                       const TraceIntelPTStartRequest &request) {
   uint64_t required = cores.size() * request.ipt_trace_size;
-  uint64_t limit = request.process_buffer_size_limit.getValueOr(
+  uint64_t limit = request.process_buffer_size_limit.value_or(
       std::numeric_limits<uint64_t>::max());
   return required > limit;
 }
diff --git a/source/Plugins/Process/Linux/Perf.cpp b/source/Plugins/Process/Linux/Perf.cpp
index 7778666..bc2038c 100644
--- a/source/Plugins/Process/Linux/Perf.cpp
+++ b/source/Plugins/Process/Linux/Perf.cpp
@@ -77,8 +77,8 @@
                                           Optional<long> group_fd,
                                           unsigned long flags) {
   errno = 0;
-  long fd = syscall(SYS_perf_event_open, &attr, pid.getValueOr(-1),
-                    cpu.getValueOr(-1), group_fd.getValueOr(-1), flags);
+  long fd = syscall(SYS_perf_event_open, &attr, pid.value_or(-1),
+                    cpu.value_or(-1), group_fd.value_or(-1), flags);
   if (fd == -1) {
     std::string err_msg =
         llvm::formatv("perf event syscall failed: {0}", std::strerror(errno));
diff --git a/source/Plugins/Process/minidump/MinidumpParser.cpp b/source/Plugins/Process/minidump/MinidumpParser.cpp
index d67db7a..7c57711 100644
--- a/source/Plugins/Process/minidump/MinidumpParser.cpp
+++ b/source/Plugins/Process/minidump/MinidumpParser.cpp
@@ -45,8 +45,7 @@
 }
 
 llvm::ArrayRef<uint8_t> MinidumpParser::GetStream(StreamType stream_type) {
-  return m_file->getRawStream(stream_type)
-      .getValueOr(llvm::ArrayRef<uint8_t>());
+  return m_file->getRawStream(stream_type).value_or(llvm::ArrayRef<uint8_t>());
 }
 
 UUID MinidumpParser::GetModuleUUID(const minidump::Module *module) {
diff --git a/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
index 41d54d0..8cacd7b 100644
--- a/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
+++ b/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
@@ -488,7 +488,7 @@
         /*is_global*/ true, /*is_debug*/ false,
         /*is_trampoline*/ false, /*is_artificial*/ false,
         AddressRange(section_sp, address - section_sp->GetFileAddress(),
-                     size.getValueOr(0)),
+                     size.value_or(0)),
         size.hasValue(), /*contains_linker_annotations*/ false, /*flags*/ 0);
   };
 
@@ -806,7 +806,7 @@
     if (record->Number >= m_files->size())
       m_files->resize(record->Number + 1);
     FileSpec::Style style = FileSpec::GuessPathStyle(record->Name)
-                                .getValueOr(FileSpec::Style::native);
+                                .value_or(FileSpec::Style::native);
     (*m_files)[record->Number] = FileSpec(record->Name, style);
   }
 }
diff --git a/source/Plugins/SymbolFile/DWARF/DIERef.h b/source/Plugins/SymbolFile/DWARF/DIERef.h
index 23e1eec..4370039 100644
--- a/source/Plugins/SymbolFile/DWARF/DIERef.h
+++ b/source/Plugins/SymbolFile/DWARF/DIERef.h
@@ -29,7 +29,7 @@
 
   DIERef(llvm::Optional<uint32_t> dwo_num, Section section,
          dw_offset_t die_offset)
-      : m_dwo_num(dwo_num.getValueOr(0)), m_dwo_num_valid(bool(dwo_num)),
+      : m_dwo_num(dwo_num.value_or(0)), m_dwo_num_valid(bool(dwo_num)),
         m_section(section), m_die_offset(die_offset) {
     assert(this->dwo_num() == dwo_num && "Dwo number out of range?");
   }
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index dc39415..2aacac3 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -614,7 +614,7 @@
     resolve_state = Type::ResolveState::Full;
     clang_type = m_ast.GetBuiltinTypeForDWARFEncodingAndBitSize(
         attrs.name.GetStringRef(), attrs.encoding,
-        attrs.byte_size.getValueOr(0) * 8);
+        attrs.byte_size.value_or(0) * 8);
     break;
 
   case DW_TAG_pointer_type:
@@ -849,7 +849,7 @@
       bool is_signed = false;
       enumerator_clang_type.IsIntegerType(is_signed);
       ParseChildEnumerators(clang_type, is_signed,
-                            type_sp->GetByteSize(nullptr).getValueOr(0), die);
+                            type_sp->GetByteSize(nullptr).value_or(0), die);
     }
     TypeSystemClang::CompleteTagDeclarationDefinition(clang_type);
   } else {
@@ -1297,7 +1297,7 @@
     attrs.bit_stride = array_info->bit_stride;
   }
   if (attrs.byte_stride == 0 && attrs.bit_stride == 0)
-    attrs.byte_stride = element_type->GetByteSize(nullptr).getValueOr(0);
+    attrs.byte_stride = element_type->GetByteSize(nullptr).value_or(0);
   CompilerType array_element_type = element_type->GetForwardCompilerType();
   RequireCompleteType(array_element_type);
 
@@ -1532,7 +1532,7 @@
     }
 
     if (dwarf->GetUniqueDWARFASTTypeMap().Find(
-            unique_typename, die, unique_decl, attrs.byte_size.getValueOr(-1),
+            unique_typename, die, unique_decl, attrs.byte_size.value_or(-1),
             *unique_ast_entry_up)) {
       type_sp = unique_ast_entry_up->m_type_sp;
       if (type_sp) {
@@ -1757,7 +1757,7 @@
   unique_ast_entry_up->m_type_sp = type_sp;
   unique_ast_entry_up->m_die = die;
   unique_ast_entry_up->m_declaration = unique_decl;
-  unique_ast_entry_up->m_byte_size = attrs.byte_size.getValueOr(0);
+  unique_ast_entry_up->m_byte_size = attrs.byte_size.value_or(0);
   dwarf->GetUniqueDWARFASTTypeMap().Insert(unique_typename,
                                            *unique_ast_entry_up);
 
@@ -2114,7 +2114,7 @@
   if (!layout_info.field_offsets.empty() || !layout_info.base_offsets.empty() ||
       !layout_info.vbase_offsets.empty()) {
     if (type)
-      layout_info.bit_size = type->GetByteSize(nullptr).getValueOr(0) * 8;
+      layout_info.bit_size = type->GetByteSize(nullptr).value_or(0) * 8;
     if (layout_info.bit_size == 0)
       layout_info.bit_size =
           die.GetAttributeValueAsUnsigned(DW_AT_byte_size, 0) * 8;
@@ -2136,7 +2136,7 @@
       bool is_signed = false;
       clang_type.IsIntegerType(is_signed);
       ParseChildEnumerators(clang_type, is_signed,
-                            type->GetByteSize(nullptr).getValueOr(0), die);
+                            type->GetByteSize(nullptr).value_or(0), die);
     }
     TypeSystemClang::CompleteTagDeclarationDefinition(clang_type);
   }
@@ -2488,7 +2488,7 @@
   // are not sane, remove them. If we don't do this then we will end up
   // with a crash if we try to use this type in an expression when clang
   // becomes unhappy with its recycled debug info.
-  if (byte_size.getValueOr(0) == 0 && bit_offset < 0) {
+  if (byte_size.value_or(0) == 0 && bit_offset < 0) {
     bit_size = 0;
     bit_offset = 0;
   }
@@ -2669,7 +2669,7 @@
 
       ObjectFile *objfile = die.GetDWARF()->GetObjectFile();
       if (objfile->GetByteOrder() == eByteOrderLittle) {
-        this_field_info.bit_offset += attrs.byte_size.getValueOr(0) * 8;
+        this_field_info.bit_offset += attrs.byte_size.value_or(0) * 8;
         this_field_info.bit_offset -= (attrs.bit_offset + attrs.bit_size);
       } else {
         this_field_info.bit_offset += attrs.bit_offset;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
index 04ccd32..903cd2e 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -789,7 +789,7 @@
       die->GetAttributeValueAsString(this, DW_AT_comp_dir, nullptr));
   if (!comp_dir.empty()) {
     FileSpec::Style comp_dir_style =
-        FileSpec::GuessPathStyle(comp_dir).getValueOr(FileSpec::Style::native);
+        FileSpec::GuessPathStyle(comp_dir).value_or(FileSpec::Style::native);
     m_comp_dir = FileSpec(comp_dir, comp_dir_style);
   } else {
     // Try to detect the style based on the DW_AT_name attribute, but just store
@@ -797,7 +797,7 @@
     const char *name =
         die->GetAttributeValueAsString(this, DW_AT_name, nullptr);
     m_comp_dir = FileSpec(
-        "", FileSpec::GuessPathStyle(name).getValueOr(FileSpec::Style::native));
+        "", FileSpec::GuessPathStyle(name).value_or(FileSpec::Style::native));
   }
 }
 
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFUnit.h b/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
index bdf13c6..265e28b 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -155,7 +155,7 @@
   const DWARFAbbreviationDeclarationSet *GetAbbreviations() const;
   dw_offset_t GetAbbrevOffset() const;
   uint8_t GetAddressByteSize() const { return m_header.GetAddressByteSize(); }
-  dw_addr_t GetAddrBase() const { return m_addr_base.getValueOr(0); }
+  dw_addr_t GetAddrBase() const { return m_addr_base.value_or(0); }
   dw_addr_t GetBaseAddress() const { return m_base_addr; }
   dw_offset_t GetLineTableOffset();
   dw_addr_t GetRangesBase() const { return m_ranges_base; }
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 2c6ab62..350e654 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1371,8 +1371,8 @@
   if (GetDebugMapSymfile())
     return GetID() | ref.die_offset();
 
-  lldbassert(GetDwoNum().getValueOr(0) <= 0x3fffffff);
-  return user_id_t(GetDwoNum().getValueOr(0)) << 32 | ref.die_offset() |
+  lldbassert(GetDwoNum().value_or(0) <= 0x3fffffff);
+  return user_id_t(GetDwoNum().value_or(0)) << 32 | ref.die_offset() |
          lldb::user_id_t(GetDwoNum().hasValue()) << 62 |
          lldb::user_id_t(ref.section() == DIERef::Section::DebugTypes) << 63;
 }
@@ -1897,7 +1897,7 @@
                     lldb::addr_t byte_size = 1;
                     if (var_sp->GetType())
                       byte_size =
-                          var_sp->GetType()->GetByteSize(nullptr).getValueOr(0);
+                          var_sp->GetType()->GetByteSize(nullptr).value_or(0);
                     m_global_aranges_up->Append(GlobalVariableMap::Entry(
                         file_addr, byte_size, var_sp.get()));
                   }
@@ -3244,7 +3244,7 @@
       DataExtractor data = die.GetCU()->GetLocationData();
       dw_offset_t offset = location_form.Unsigned();
       if (location_form.Form() == DW_FORM_loclistx)
-        offset = die.GetCU()->GetLoclistOffset(offset).getValueOr(-1);
+        offset = die.GetCU()->GetLoclistOffset(offset).value_or(-1);
       if (data.ValidOffset(offset)) {
         data = DataExtractor(data, offset, data.GetByteSize() - offset);
         location = DWARFExpression(module, data, die.GetCU());
@@ -3465,7 +3465,7 @@
 
   if (use_type_size_for_value && type_sp->GetType())
     location.UpdateValue(const_value_form.Unsigned(),
-                         type_sp->GetType()->GetByteSize(nullptr).getValueOr(0),
+                         type_sp->GetType()->GetByteSize(nullptr).value_or(0),
                          die.GetCU()->GetAddressByteSize());
 
   return std::make_shared<Variable>(
diff --git a/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp b/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp
index 30d948a..f426d3d 100644
--- a/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp
+++ b/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp
@@ -71,7 +71,7 @@
     return {};
 
   m_bases.push_back(
-      std::make_pair(vtable_idx.getValueOr(0), std::move(base_spec)));
+      std::make_pair(vtable_idx.value_or(0), std::move(base_spec)));
 
   return qt;
 }
diff --git a/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
index e323635..c3f424d 100644
--- a/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ b/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -711,7 +711,7 @@
       bytes = size;
     Encoding encoding = TranslateBuiltinEncoding(builtin_kind);
     CompilerType builtin_ast_type = GetBuiltinTypeForPDBEncodingAndBitSize(
-        m_ast, *builtin_type, encoding, bytes.getValueOr(0) * 8);
+        m_ast, *builtin_type, encoding, bytes.value_or(0) * 8);
 
     if (builtin_type->isConstType())
       builtin_ast_type = builtin_ast_type.AddConstModifier();
diff --git a/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
index 5567ca4..bd3d16a 100644
--- a/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
+++ b/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
@@ -797,7 +797,7 @@
   std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
   const size_t old_size = sc_list.GetSize();
   const FileSpec &file_spec = src_location_spec.GetFileSpec();
-  const uint32_t line = src_location_spec.GetLine().getValueOr(0);
+  const uint32_t line = src_location_spec.GetLine().value_or(0);
   if (resolve_scope & lldb::eSymbolContextCompUnit) {
     // Locate all compilation units with line numbers referencing the specified
     // file.  For example, if `file_spec` is <vector>, then this should return
diff --git a/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index 0a98f50..61e06cd 100644
--- a/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -74,7 +74,7 @@
   FileSpec fspec = module_sp->GetSymbolFileFileSpec();
   // Otherwise, try gnu_debuglink, if one exists.
   if (!fspec)
-    fspec = obj_file->GetDebugLink().getValueOr(FileSpec());
+    fspec = obj_file->GetDebugLink().value_or(FileSpec());
 
   LLDB_SCOPED_TIMERF("SymbolVendorELF::CreateInstance (module = %s)",
                      module_sp->GetFileSpec().GetPath().c_str());
diff --git a/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp b/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp
index e08753b..9b65124 100644
--- a/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp
+++ b/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp
@@ -74,7 +74,7 @@
   FileSpec fspec = module_sp->GetSymbolFileFileSpec();
   // Otherwise, try gnu_debuglink, if one exists.
   if (!fspec)
-    fspec = obj_file->GetDebugLink().getValueOr(FileSpec());
+    fspec = obj_file->GetDebugLink().value_or(FileSpec());
 
   LLDB_SCOPED_TIMERF("SymbolVendorPECOFF::CreateInstance (module = %s)",
                      module_sp->GetFileSpec().GetPath().c_str());
diff --git a/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp b/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp
index a72e46a..29b1476 100644
--- a/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp
+++ b/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp
@@ -73,7 +73,7 @@
 
   if (thread == nullptr) {
     const uint32_t num_threads = process->GetThreadList().GetSize();
-    size_t tid = m_options.m_thread_index.getValueOr(LLDB_INVALID_THREAD_ID);
+    size_t tid = m_options.m_thread_index.value_or(LLDB_INVALID_THREAD_ID);
     result.AppendErrorWithFormatv(
         "Thread index {0} is out of range (valid values are 1 - {1}).\n", tid,
         num_threads);
diff --git a/source/Symbol/CompileUnit.cpp b/source/Symbol/CompileUnit.cpp
index 3ce908b..422f8a5 100644
--- a/source/Symbol/CompileUnit.cpp
+++ b/source/Symbol/CompileUnit.cpp
@@ -249,7 +249,7 @@
     const SourceLocationSpec &src_location_spec,
     SymbolContextItem resolve_scope, SymbolContextList &sc_list) {
   const FileSpec file_spec = src_location_spec.GetFileSpec();
-  const uint32_t line = src_location_spec.GetLine().getValueOr(0);
+  const uint32_t line = src_location_spec.GetLine().value_or(0);
   const bool check_inlines = src_location_spec.GetCheckInlines();
 
   // First find all of the file indexes that match our "file_spec". If
diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp
index ac88163..4ee5a3e 100644
--- a/source/Symbol/Type.cpp
+++ b/source/Symbol/Type.cpp
@@ -324,7 +324,7 @@
         exe_ctx, s, format == lldb::eFormatDefault ? GetFormat() : format, data,
         data_byte_offset,
         GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr)
-            .getValueOr(0),
+            .value_or(0),
         0, // Bitfield bit size
         0, // Bitfield bit offset
         show_types, show_summary, verbose, 0);
@@ -434,7 +434,7 @@
 
   const uint64_t byte_size =
       GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr)
-          .getValueOr(0);
+          .value_or(0);
   if (data.GetByteSize() < byte_size) {
     lldb::DataBufferSP data_sp(new DataBufferHeap(byte_size, '\0'));
     data.SetData(data_sp);
diff --git a/source/Target/PathMappingList.cpp b/source/Target/PathMappingList.cpp
index f699b8b..4ebb175 100644
--- a/source/Target/PathMappingList.cpp
+++ b/source/Target/PathMappingList.cpp
@@ -188,7 +188,7 @@
         continue;
     }
     FileSpec remapped(it.second.GetStringRef());
-    auto orig_style = FileSpec::GuessPathStyle(prefix).getValueOr(
+    auto orig_style = FileSpec::GuessPathStyle(prefix).value_or(
         llvm::sys::path::Style::native);
     AppendPathComponents(remapped, path, orig_style);
     if (!only_if_exists || FileSystem::Instance().Exists(remapped))
@@ -204,7 +204,7 @@
     if (!path_ref.consume_front(it.second.GetStringRef()))
       continue;
     auto orig_file = it.first.GetStringRef();
-    auto orig_style = FileSpec::GuessPathStyle(orig_file).getValueOr(
+    auto orig_style = FileSpec::GuessPathStyle(orig_file).value_or(
         llvm::sys::path::Style::native);
     fixed.SetFile(orig_file, orig_style);
     AppendPathComponents(fixed, path_ref, orig_style);
diff --git a/source/Target/StackFrame.cpp b/source/Target/StackFrame.cpp
index a5cb575..1e3dbc7 100644
--- a/source/Target/StackFrame.cpp
+++ b/source/Target/StackFrame.cpp
@@ -1390,7 +1390,7 @@
     }
 
     int64_t child_offset = child_sp->GetByteOffset();
-    int64_t child_size = child_sp->GetByteSize().getValueOr(0);
+    int64_t child_size = child_sp->GetByteSize().value_or(0);
 
     if (offset >= child_offset && offset < (child_offset + child_size)) {
       return GetValueForOffset(frame, child_sp, offset - child_offset);
@@ -1423,8 +1423,8 @@
   }
 
   if (offset >= 0 && uint64_t(offset) >= pointee->GetByteSize()) {
-    int64_t index = offset / pointee->GetByteSize().getValueOr(1);
-    offset = offset % pointee->GetByteSize().getValueOr(1);
+    int64_t index = offset / pointee->GetByteSize().value_or(1);
+    offset = offset % pointee->GetByteSize().value_or(1);
     const bool can_create = true;
     pointee = base->GetSyntheticArrayMember(index, can_create);
   }
diff --git a/source/Utility/ProcessInfo.cpp b/source/Utility/ProcessInfo.cpp
index 957bba2..3b09429 100644
--- a/source/Utility/ProcessInfo.cpp
+++ b/source/Utility/ProcessInfo.cpp
@@ -144,19 +144,19 @@
 
   if (UserIDIsValid()) {
     s.Format("    uid = {0,-5} ({1})\n", GetUserID(),
-             resolver.GetUserName(GetUserID()).getValueOr(""));
+             resolver.GetUserName(GetUserID()).value_or(""));
   }
   if (GroupIDIsValid()) {
     s.Format("    gid = {0,-5} ({1})\n", GetGroupID(),
-             resolver.GetGroupName(GetGroupID()).getValueOr(""));
+             resolver.GetGroupName(GetGroupID()).value_or(""));
   }
   if (EffectiveUserIDIsValid()) {
     s.Format("   euid = {0,-5} ({1})\n", GetEffectiveUserID(),
-             resolver.GetUserName(GetEffectiveUserID()).getValueOr(""));
+             resolver.GetUserName(GetEffectiveUserID()).value_or(""));
   }
   if (EffectiveGroupIDIsValid()) {
     s.Format("   egid = {0,-5} ({1})\n", GetEffectiveGroupID(),
-             resolver.GetGroupName(GetEffectiveGroupID()).getValueOr(""));
+             resolver.GetGroupName(GetEffectiveGroupID()).value_or(""));
   }
 }
 
diff --git a/source/Utility/TraceIntelPTGDBRemotePackets.cpp b/source/Utility/TraceIntelPTGDBRemotePackets.cpp
index 913825c..1ad74ca 100644
--- a/source/Utility/TraceIntelPTGDBRemotePackets.cpp
+++ b/source/Utility/TraceIntelPTGDBRemotePackets.cpp
@@ -19,7 +19,7 @@
     "perfContextSwitchTrace";
 
 bool TraceIntelPTStartRequest::IsPerCpuTracing() const {
-  return per_cpu_tracing.getValueOr(false);
+  return per_cpu_tracing.value_or(false);
 }
 
 json::Value toJSON(const JSONUINT64 &uint64, bool hex) {