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/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp') diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 8cc0e8d..0213bcc 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -821,7 +821,7 @@ UUID ObjectFileELF::GetUUID() { return m_uuid; } -llvm::Optional ObjectFileELF::GetDebugLink() { +std::optional ObjectFileELF::GetDebugLink() { if (m_gnu_debuglink_file.empty()) return std::nullopt; return FileSpec(m_gnu_debuglink_file); @@ -1767,7 +1767,7 @@ public: return llvm::formatv("{0}[{1}]", SegmentName, SegmentCount).str(); } - llvm::Optional GetAddressInfo(const ELFProgramHeader &H) { + std::optional GetAddressInfo(const ELFProgramHeader &H) { if (H.p_memsz == 0) { LLDB_LOG(Log, "Ignoring zero-sized {0} segment. Corrupt object file?", SegmentName); @@ -1782,7 +1782,7 @@ public: return VMRange(H.p_vaddr, H.p_memsz); } - llvm::Optional GetAddressInfo(const ELFSectionHeader &H) { + std::optional GetAddressInfo(const ELFSectionHeader &H) { VMRange Range = GetVMRange(H); SectionSP Segment; auto It = Segments.find(Range.GetRangeBase()); -- cgit v1.1