diff options
author | Kazu Hirata <kazu@google.com> | 2023-01-07 14:18:35 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-01-07 14:18:35 -0800 |
commit | 2fe8327406050d2585d2ced910a678e28caefcf5 (patch) | |
tree | da95c78fa33c17cf7829bbe6f5e0bfa62e0579ae /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | |
parent | f190ce625ab0dc5a5e2b2515e6d26debb34843ab (diff) | |
download | llvm-2fe8327406050d2585d2ced910a678e28caefcf5.zip llvm-2fe8327406050d2585d2ced910a678e28caefcf5.tar.gz llvm-2fe8327406050d2585d2ced910a678e28caefcf5.tar.bz2 |
[lldb] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to clean up the "using" declarations, #include
"llvm/ADT/Optional.h", etc.
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/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 40c3e34..5fb26ad 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1311,7 +1311,7 @@ NativeProcessLinux::Syscall(llvm::ArrayRef<uint64_t> args) { llvm::Expected<addr_t> NativeProcessLinux::AllocateMemory(size_t size, uint32_t permissions) { - llvm::Optional<NativeRegisterContextLinux::MmapData> mmap_data = + std::optional<NativeRegisterContextLinux::MmapData> mmap_data = GetCurrentThread()->GetRegisterContext().GetMmapData(); if (!mmap_data) return llvm::make_error<UnimplementedError>(); @@ -1336,7 +1336,7 @@ NativeProcessLinux::AllocateMemory(size_t size, uint32_t permissions) { } llvm::Error NativeProcessLinux::DeallocateMemory(lldb::addr_t addr) { - llvm::Optional<NativeRegisterContextLinux::MmapData> mmap_data = + std::optional<NativeRegisterContextLinux::MmapData> mmap_data = GetCurrentThread()->GetRegisterContext().GetMmapData(); if (!mmap_data) return llvm::make_error<UnimplementedError>(); @@ -1870,7 +1870,7 @@ void NativeProcessLinux::ThreadWasCreated(NativeThreadLinux &thread) { } } -static llvm::Optional<WaitStatus> HandlePid(::pid_t pid) { +static std::optional<WaitStatus> HandlePid(::pid_t pid) { Log *log = GetLog(POSIXLog::Process); int status; @@ -1906,13 +1906,13 @@ void NativeProcessLinux::SigchldHandler() { if (thread_up->GetID() == GetID()) checked_main_thread = true; - if (llvm::Optional<WaitStatus> status = HandlePid(thread_up->GetID())) + if (std::optional<WaitStatus> status = HandlePid(thread_up->GetID())) tid_events.try_emplace(thread_up->GetID(), *status); } // Check the main thread even when we're not tracking it as process exit // events are reported that way. if (!checked_main_thread) { - if (llvm::Optional<WaitStatus> status = HandlePid(GetID())) + if (std::optional<WaitStatus> status = HandlePid(GetID())) tid_events.try_emplace(GetID(), *status); } |