[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
This commit is contained in:
Kazu Hirata
2022-12-04 16:51:25 -08:00
parent 5fa43db46e
commit 343523d040
134 changed files with 400 additions and 396 deletions

View File

@@ -70,7 +70,7 @@ llvm::Optional<WaitStatus> NativeProcessProtocol::GetExitStatus() {
if (m_state == lldb::eStateExited)
return m_exit_status;
return llvm::None;
return std::nullopt;
}
bool NativeProcessProtocol::SetExitStatus(WaitStatus status,
@@ -136,7 +136,7 @@ NativeProcessProtocol::GetHardwareDebugSupportInfo() const {
const_cast<NativeProcessProtocol *>(this)->GetThreadAtIndex(0));
if (!thread) {
LLDB_LOG(log, "failed to find a thread to grab a NativeRegisterContext!");
return llvm::None;
return std::nullopt;
}
NativeRegisterContext &reg_ctx = thread->GetRegisterContext();
@@ -245,7 +245,7 @@ Status NativeProcessProtocol::SetHardwareBreakpoint(lldb::addr_t addr,
// Exit here if target does not have required hardware breakpoint capability.
auto hw_debug_cap = GetHardwareDebugSupportInfo();
if (hw_debug_cap == llvm::None || hw_debug_cap->first == 0 ||
if (hw_debug_cap == std::nullopt || hw_debug_cap->first == 0 ||
hw_debug_cap->first <= m_hw_breakpoints_map.size())
return Status("Target does not have required no of hardware breakpoints");