[lldb] Use std::nullopt instead of llvm::None (NFC)
authorKazu Hirata <kazu@google.com>
Tue, 6 Dec 2022 06:43:53 +0000 (22:43 -0800)
committerKazu Hirata <kazu@google.com>
Tue, 6 Dec 2022 06:43:53 +0000 (22:43 -0800)
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

lldb/bindings/python/python-wrapper.swig

index adac8a4..7342d9d 100644 (file)
@@ -946,7 +946,7 @@ llvm::Optional<std::string> lldb_private::LLDBSWIGPythonRunScriptKeywordThread(
     lldb::ThreadSP thread) {
   if (python_function_name == NULL || python_function_name[0] == '\0' ||
       !session_dictionary_name)
-    return llvm::None;
+    return std::nullopt;
 
   PyErr_Cleaner py_err_cleaner(true);
 
@@ -956,7 +956,7 @@ llvm::Optional<std::string> lldb_private::LLDBSWIGPythonRunScriptKeywordThread(
       python_function_name, dict);
 
   if (!pfunc.IsAllocated())
-    return llvm::None;
+    return std::nullopt;
 
   auto result = pfunc(ToSWIGWrapper(std::move(thread)), dict);
 
@@ -993,7 +993,7 @@ llvm::Optional<std::string> lldb_private::LLDBSWIGPythonRunScriptKeywordFrame(
     lldb::StackFrameSP frame) {
   if (python_function_name == NULL || python_function_name[0] == '\0' ||
       !session_dictionary_name)
-    return llvm::None;
+    return std::nullopt;
 
   PyErr_Cleaner py_err_cleaner(true);
 
@@ -1003,7 +1003,7 @@ llvm::Optional<std::string> lldb_private::LLDBSWIGPythonRunScriptKeywordFrame(
       python_function_name, dict);
 
   if (!pfunc.IsAllocated())
-    return llvm::None;
+    return std::nullopt;
 
   auto result = pfunc(ToSWIGWrapper(std::move(frame)), dict);