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/Commands/CommandObjectThread.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/Commands/CommandObjectThread.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 5c4674d68..750bf74 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -125,8 +125,8 @@ public: Options *GetOptions() override { return &m_options; } - llvm::Optional<std::string> GetRepeatCommand(Args ¤t_args, - uint32_t idx) override { + std::optional<std::string> GetRepeatCommand(Args ¤t_args, + uint32_t idx) override { llvm::StringRef count_opt("--count"); llvm::StringRef start_opt("--start"); @@ -2161,7 +2161,7 @@ public: // Instance variables to hold the values for command options. TraceDumperOptions m_dumper_options; - llvm::Optional<FileSpec> m_output_file; + std::optional<FileSpec> m_output_file; }; CommandObjectTraceDumpFunctionCalls(CommandInterpreter &interpreter) @@ -2198,7 +2198,7 @@ protected: } TraceCursorSP &cursor_sp = *cursor_or_error; - llvm::Optional<StreamFile> out_file; + std::optional<StreamFile> out_file; if (m_options.m_output_file) { out_file.emplace(m_options.m_output_file->GetPath().c_str(), File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate | @@ -2335,7 +2335,7 @@ public: // Instance variables to hold the values for command options. size_t m_count; size_t m_continue; - llvm::Optional<FileSpec> m_output_file; + std::optional<FileSpec> m_output_file; TraceDumperOptions m_dumper_options; }; @@ -2356,8 +2356,8 @@ public: Options *GetOptions() override { return &m_options; } - llvm::Optional<std::string> GetRepeatCommand(Args ¤t_command_args, - uint32_t index) override { + std::optional<std::string> GetRepeatCommand(Args ¤t_command_args, + uint32_t index) override { std::string cmd; current_command_args.GetCommandString(cmd); if (cmd.find(" --continue") == std::string::npos) @@ -2395,7 +2395,7 @@ protected: return false; } - llvm::Optional<StreamFile> out_file; + std::optional<StreamFile> out_file; if (m_options.m_output_file) { out_file.emplace(m_options.m_output_file->GetPath().c_str(), File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate | @@ -2420,7 +2420,7 @@ protected: CommandOptions m_options; // Last traversed id used to continue a repeat command. None means // that all the trace has been consumed. - llvm::Optional<lldb::user_id_t> m_last_id; + std::optional<lldb::user_id_t> m_last_id; }; // CommandObjectTraceDumpInfo |