diff options
author | Krzysztof Parzyszek <kparzysz@quicinc.com> | 2022-12-03 16:01:15 -0600 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@quicinc.com> | 2022-12-04 11:52:02 -0600 |
commit | 0ca43d44888885d6caf7636db91fe810e822263c (patch) | |
tree | 1b8e5ee0f5ae8e0163d551a99fcfccd33aa27456 /llvm/lib/Bitcode | |
parent | fcf4e360ba6b5f005d2c478ca79112be7a61dacb (diff) | |
download | llvm-0ca43d44888885d6caf7636db91fe810e822263c.zip llvm-0ca43d44888885d6caf7636db91fe810e822263c.tar.gz llvm-0ca43d44888885d6caf7636db91fe810e822263c.tar.bz2 |
DebugInfoMetadata: convert Optional to std::optional
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp index fd493a5..adb36e9 100644 --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -55,6 +55,7 @@ #include <deque> #include <iterator> #include <limits> +#include <optional> #include <string> #include <tuple> #include <type_traits> @@ -1448,7 +1449,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( // DWARF address space is encoded as N->getDWARFAddressSpace() + 1. 0 means // that there is no DWARF address space associated with DIDerivedType. - Optional<unsigned> DWARFAddressSpace; + std::optional<unsigned> DWARFAddressSpace; if (Record.size() > 12 && Record[12]) DWARFAddressSpace = Record[12] - 1; @@ -1611,7 +1612,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( return error("Invalid record"); IsDistinct = Record[0]; - Optional<DIFile::ChecksumInfo<MDString *>> Checksum; + std::optional<DIFile::ChecksumInfo<MDString *>> Checksum; // The BitcodeWriter writes null bytes into Record[3:4] when the Checksum // is not present. This matches up with the old internal representation, // and the old encoding for CSK_None in the ChecksumKind. The new @@ -1621,11 +1622,11 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( Checksum.emplace(static_cast<DIFile::ChecksumKind>(Record[3]), getMDString(Record[4])); MetadataList.assignValue( - GET_OR_DISTINCT( - DIFile, - (Context, getMDString(Record[1]), getMDString(Record[2]), Checksum, - Record.size() > 5 ? Optional<MDString *>(getMDString(Record[5])) - : std::nullopt)), + GET_OR_DISTINCT(DIFile, (Context, getMDString(Record[1]), + getMDString(Record[2]), Checksum, + Record.size() > 5 ? std::optional<MDString *>( + getMDString(Record[5])) + : std::nullopt)), NextMetadataNo); NextMetadataNo++; break; |