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/llvm/lib/BinaryFormat/Dwarf.cpp | |
parent | 781624ca2d054430052c828ba8d2c2eaf2d733e7 (diff) | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/BinaryFormat/Dwarf.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/BinaryFormat/Dwarf.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/llvm-project/llvm/lib/BinaryFormat/Dwarf.cpp b/contrib/llvm-project/llvm/lib/BinaryFormat/Dwarf.cpp index c88425711656..a9bbe41125b1 100644 --- a/contrib/llvm-project/llvm/lib/BinaryFormat/Dwarf.cpp +++ b/contrib/llvm-project/llvm/lib/BinaryFormat/Dwarf.cpp @@ -365,10 +365,11 @@ unsigned llvm::dwarf::LanguageVendor(dwarf::SourceLanguage Lang) { } } -Optional<unsigned> llvm::dwarf::LanguageLowerBound(dwarf::SourceLanguage Lang) { +std::optional<unsigned> +llvm::dwarf::LanguageLowerBound(dwarf::SourceLanguage Lang) { switch (Lang) { default: - return None; + return std::nullopt; #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ case DW_LANG_##NAME: \ return LOWER_BOUND; @@ -691,13 +692,13 @@ StringRef llvm::dwarf::IndexString(unsigned Idx) { } } -Optional<uint8_t> llvm::dwarf::getFixedFormByteSize(dwarf::Form Form, - FormParams Params) { +std::optional<uint8_t> llvm::dwarf::getFixedFormByteSize(dwarf::Form Form, + FormParams Params) { switch (Form) { case DW_FORM_addr: if (Params) return Params.AddrSize; - return None; + return std::nullopt; case DW_FORM_block: // ULEB128 length L followed by L bytes. case DW_FORM_block1: // 1 byte length L followed by L bytes. @@ -715,12 +716,12 @@ Optional<uint8_t> llvm::dwarf::getFixedFormByteSize(dwarf::Form Form, case DW_FORM_rnglistx: // ULEB128. case DW_FORM_GNU_addr_index: // ULEB128. case DW_FORM_GNU_str_index: // ULEB128. - return None; + return std::nullopt; case DW_FORM_ref_addr: if (Params) return Params.getRefAddrByteSize(); - return None; + return std::nullopt; case DW_FORM_flag: case DW_FORM_data1: @@ -753,7 +754,7 @@ Optional<uint8_t> llvm::dwarf::getFixedFormByteSize(dwarf::Form Form, case DW_FORM_strp_sup: if (Params) return Params.getDwarfOffsetByteSize(); - return None; + return std::nullopt; case DW_FORM_data8: case DW_FORM_ref8: @@ -775,7 +776,7 @@ Optional<uint8_t> llvm::dwarf::getFixedFormByteSize(dwarf::Form Form, default: break; } - return None; + return std::nullopt; } bool llvm::dwarf::isValidFormForVersion(Form F, unsigned Version, |