[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
This commit is contained in:
Kazu Hirata committed 2023-01-07 14:18:35 -08:00
1 parent f190ce625a
commit 2fe8327406
387 files changed
+1323 -1324

No files matched your search

@@ -71,7 +71,7 @@ lldb::tid_t ScriptedThreadPythonInterface::GetThreadID() {
return obj->GetIntegerValue(LLDB_INVALID_THREAD_ID);
}
llvm::Optional<std::string> ScriptedThreadPythonInterface::GetName() {
std::optional<std::string> ScriptedThreadPythonInterface::GetName() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_name", error);
@@ -91,7 +91,7 @@ lldb::StateType ScriptedThreadPythonInterface::GetState() {
return static_cast<StateType>(obj->GetIntegerValue(eStateInvalid));
}
llvm::Optional<std::string> ScriptedThreadPythonInterface::GetQueue() {
std::optional<std::string> ScriptedThreadPythonInterface::GetQueue() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_queue", error);
@@ -134,8 +134,7 @@ StructuredData::DictionarySP ScriptedThreadPythonInterface::GetRegisterInfo() {
return dict;
}
llvm::Optional<std::string>
ScriptedThreadPythonInterface::GetRegisterContext() {
std::optional<std::string> ScriptedThreadPythonInterface::GetRegisterContext() {
Status error;
StructuredData::ObjectSP obj = Dispatch("get_register_context", error);