From 2fe8327406050d2585d2ced910a678e28caefcf5 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 7 Jan 2023 14:18:35 -0800 Subject: [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 --- lldb/source/Core/Module.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lldb/source/Core/Module.cpp') diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index f32b2bd97aa5..2f111be08d09 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -1126,7 +1126,7 @@ bool Module::FileHasChanged() const { } void Module::ReportWarningOptimization( - llvm::Optional debugger_id) { + std::optional debugger_id) { ConstString file_name = GetFileSpec().GetFilename(); if (file_name.IsEmpty()) return; @@ -1140,7 +1140,7 @@ void Module::ReportWarningOptimization( } void Module::ReportWarningUnsupportedLanguage( - LanguageType language, llvm::Optional debugger_id) { + LanguageType language, std::optional debugger_id) { StreamString ss; ss << "This version of LLDB has no plugin for the language \"" << Language::GetNameForLanguageType(language) @@ -1635,8 +1635,7 @@ bool Module::FindSourceFile(const FileSpec &orig_spec, return false; } -llvm::Optional -Module::RemapSourceFile(llvm::StringRef path) const { +std::optional Module::RemapSourceFile(llvm::StringRef path) const { std::lock_guard guard(m_mutex); if (auto remapped = m_source_mappings.RemapPath(path)) return remapped->GetPath(); -- cgit v1.2.3