diff options
author | Kazu Hirata <kazu@google.com> | 2022-06-19 09:12:01 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-06-19 09:12:01 -0700 |
commit | aa88161b378ecb49388eefc28abe2926a229bcfc (patch) | |
tree | 62b3139d6f697fdfbfeb913c8bc54c01fd86872d /lldb/source/Expression/Materializer.cpp | |
parent | 0399473de886595d8ce3346f2cc99c94267496e5 (diff) | |
download | llvm-aa88161b378ecb49388eefc28abe2926a229bcfc.zip llvm-aa88161b378ecb49388eefc28abe2926a229bcfc.tar.gz llvm-aa88161b378ecb49388eefc28abe2926a229bcfc.tar.bz2 |
[lldb] Use value_or instead of getValueOr (NFC)
Diffstat (limited to 'lldb/source/Expression/Materializer.cpp')
-rw-r--r-- | lldb/source/Expression/Materializer.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp index feabfd4..9ee2d98 100644 --- a/lldb/source/Expression/Materializer.cpp +++ b/lldb/source/Expression/Materializer.cpp @@ -68,7 +68,7 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: 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 @@ public: "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 @@ public: 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 @@ public: 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); |