summaryrefslogtreecommitdiff
path: root/lldb/source/Target/Process.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/Target/Process.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/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 694e5dc93e67..f12a01df86b7 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -1372,8 +1372,8 @@ Status Process::ResumeSynchronous(Stream *stream) {
Status error = PrivateResume();
if (error.Success()) {
- StateType state = WaitForProcessToStop(llvm::None, nullptr, true,
- listener_sp, stream);
+ StateType state =
+ WaitForProcessToStop(std::nullopt, nullptr, true, listener_sp, stream);
const bool must_be_alive =
false; // eStateExited is ok, so this must be false
if (!StateIsStoppedState(state, must_be_alive))
@@ -2636,7 +2636,7 @@ Status Process::LoadCore() {
// Wait for a stopped event since we just posted one above...
lldb::EventSP event_sp;
StateType state =
- WaitForProcessToStop(llvm::None, &event_sp, true, listener_sp);
+ WaitForProcessToStop(std::nullopt, &event_sp, true, listener_sp);
if (!StateIsStoppedState(state, false)) {
Log *log = GetLog(LLDBLog::Process);
@@ -3038,7 +3038,7 @@ Status Process::ConnectRemote(llvm::StringRef remote_url) {
if (error.Success()) {
if (GetID() != LLDB_INVALID_PROCESS_ID) {
EventSP event_sp;
- StateType state = WaitForProcessStopPrivate(event_sp, llvm::None);
+ StateType state = WaitForProcessStopPrivate(event_sp, std::nullopt);
if (state == eStateStopped || state == eStateCrashed) {
// If we attached and actually have a process on the other end, then
@@ -3785,7 +3785,7 @@ thread_result_t Process::RunPrivateStateThread(bool is_secondary_thread) {
bool interrupt_requested = false;
while (!exit_now) {
EventSP event_sp;
- GetEventsPrivate(event_sp, llvm::None, control_only);
+ GetEventsPrivate(event_sp, std::nullopt, control_only);
if (event_sp->BroadcasterIs(&m_private_state_control_broadcaster)) {
LLDB_LOGF(log,
"Process::%s (arg = %p, pid = %" PRIu64
@@ -4609,7 +4609,7 @@ GetExpressionTimeout(const EvaluateExpressionOptions &options,
return GetOneThreadExpressionTimeout(options);
if (!options.GetTimeout())
- return llvm::None;
+ return std::nullopt;
else
return *options.GetTimeout() - GetOneThreadExpressionTimeout(options);
}
@@ -4663,7 +4663,7 @@ HandleStoppedEvent(lldb::tid_t thread_id, const ThreadPlanSP &thread_plan_sp,
if (!handle_interrupts &&
Process::ProcessEventData::GetInterruptedFromEvent(event_sp.get()))
- return llvm::None;
+ return std::nullopt;
LLDB_LOG(log, "thread plan did not successfully complete");
if (!options.DoesUnwindOnError())