summaryrefslogtreecommitdiff
path: root/lldb/source/Core/DumpDataExtractor.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-04 16:51:25 -0800
committerKazu Hirata <kazu@google.com>2022-12-04 16:51:25 -0800
commit343523d040d1ede65a35d8a6d514b0f7c198a3f2 (patch)
tree315214eb1475196d988f6dde049cf93afd5327dc /lldb/source/Core/DumpDataExtractor.cpp
parent5fa43db46ef9f05400e4fb4d9d8e5fb1781eeae5 (diff)
[lldb] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Diffstat (limited to 'lldb/source/Core/DumpDataExtractor.cpp')
-rw-r--r--lldb/source/Core/DumpDataExtractor.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Core/DumpDataExtractor.cpp b/lldb/source/Core/DumpDataExtractor.cpp
index ec98d6266241..85b0dd2d943a 100644
--- a/lldb/source/Core/DumpDataExtractor.cpp
+++ b/lldb/source/Core/DumpDataExtractor.cpp
@@ -54,7 +54,7 @@ static llvm::Optional<llvm::APInt> GetAPInt(const DataExtractor &data,
lldb::offset_t *offset_ptr,
lldb::offset_t byte_size) {
if (byte_size == 0)
- return llvm::None;
+ return std::nullopt;
llvm::SmallVector<uint64_t, 2> uint64_array;
lldb::offset_t bytes_left = byte_size;
@@ -92,7 +92,7 @@ static llvm::Optional<llvm::APInt> GetAPInt(const DataExtractor &data,
*offset_ptr += byte_size;
return llvm::APInt(byte_size * 8, llvm::ArrayRef<uint64_t>(uint64_array));
}
- return llvm::None;
+ return std::nullopt;
}
static lldb::offset_t DumpAPInt(Stream *s, const DataExtractor &data,
@@ -244,21 +244,21 @@ GetMemoryTags(lldb::addr_t addr, size_t length,
assert(addr != LLDB_INVALID_ADDRESS);
if (!exe_scope)
- return llvm::None;
+ return std::nullopt;
TargetSP target_sp = exe_scope->CalculateTarget();
if (!target_sp)
- return llvm::None;
+ return std::nullopt;
ProcessSP process_sp = target_sp->CalculateProcess();
if (!process_sp)
- return llvm::None;
+ return std::nullopt;
llvm::Expected<const MemoryTagManager *> tag_manager_or_err =
process_sp->GetMemoryTagManager();
if (!tag_manager_or_err) {
llvm::consumeError(tag_manager_or_err.takeError());
- return llvm::None;
+ return std::nullopt;
}
MemoryRegionInfos memory_regions;
@@ -272,10 +272,10 @@ GetMemoryTags(lldb::addr_t addr, size_t length,
// for an error.
if (!tagged_ranges_or_err) {
llvm::consumeError(tagged_ranges_or_err.takeError());
- return llvm::None;
+ return std::nullopt;
}
if (tagged_ranges_or_err->empty())
- return llvm::None;
+ return std::nullopt;
MemoryTagMap memory_tag_map(*tag_manager_or_err);
for (const MemoryTagManager::TagRange &range : *tagged_ranges_or_err) {
@@ -289,7 +289,7 @@ GetMemoryTags(lldb::addr_t addr, size_t length,
}
if (memory_tag_map.Empty())
- return llvm::None;
+ return std::nullopt;
return memory_tag_map;
}