diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-04-14 21:41:27 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-06-22 18:20:56 +0000 |
commit | bdd1243df58e60e85101c09001d9812a789b6bc4 (patch) | |
tree | a1ce621c7301dd47ba2ddc3b8eaa63b441389481 /contrib/llvm-project/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp | |
parent | 781624ca2d054430052c828ba8d2c2eaf2d733e7 (diff) | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) |
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp b/contrib/llvm-project/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp index c591a4a7534c..33673f139b49 100644 --- a/contrib/llvm-project/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp @@ -11,6 +11,7 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" +#include <optional> using namespace lldb; using namespace lldb_private; @@ -22,16 +23,16 @@ namespace { struct Header { ArchSpec arch; UUID uuid; - static llvm::Optional<Header> parse(llvm::StringRef text); + static std::optional<Header> parse(llvm::StringRef text); }; } // namespace -llvm::Optional<Header> Header::parse(llvm::StringRef text) { +std::optional<Header> Header::parse(llvm::StringRef text) { llvm::StringRef line; std::tie(line, text) = text.split('\n'); auto Module = ModuleRecord::parse(line); if (!Module) - return llvm::None; + return std::nullopt; llvm::Triple triple; triple.setArch(Module->Arch); @@ -66,7 +67,7 @@ ObjectFile *ObjectFileBreakpad::CreateInstance( data_offset = 0; } auto text = toStringRef(data_sp->GetData()); - llvm::Optional<Header> header = Header::parse(text); + std::optional<Header> header = Header::parse(text); if (!header) return nullptr; @@ -93,7 +94,7 @@ size_t ObjectFileBreakpad::GetModuleSpecifications( const FileSpec &file, DataBufferSP &data_sp, offset_t data_offset, offset_t file_offset, offset_t length, ModuleSpecList &specs) { auto text = toStringRef(data_sp->GetData()); - llvm::Optional<Header> header = Header::parse(text); + std::optional<Header> header = Header::parse(text); if (!header) return 0; ModuleSpec spec(file, std::move(header->arch)); @@ -127,7 +128,7 @@ void ObjectFileBreakpad::CreateSections(SectionList &unified_section_list) { return; m_sections_up = std::make_unique<SectionList>(); - llvm::Optional<Record::Kind> current_section; + std::optional<Record::Kind> current_section; offset_t section_start; llvm::StringRef text = toStringRef(m_data.GetData()); uint32_t next_section_id = 1; @@ -148,7 +149,7 @@ void ObjectFileBreakpad::CreateSections(SectionList &unified_section_list) { llvm::StringRef line; std::tie(line, text) = text.split('\n'); - llvm::Optional<Record::Kind> next_section = Record::classify(line); + std::optional<Record::Kind> next_section = Record::classify(line); if (next_section == Record::Line || next_section == Record::Inline) { // Line/Inline records logically belong to the preceding Func record, so // we put them in the same section. |