diff options
author | Kazu Hirata <kazu@google.com> | 2022-11-25 11:33:19 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-11-25 11:33:20 -0800 |
commit | f960b935ccf61f93915c4a3275f553d709322cdc (patch) | |
tree | cb68bc3ed9af2ee807c084f41d022ceedc85ff53 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 5ea708375f507a783a44fe9864067ba4b425f777 (diff) | |
download | llvm-f960b935ccf61f93915c4a3275f553d709322cdc.zip llvm-f960b935ccf61f93915c4a3275f553d709322cdc.tar.gz llvm-f960b935ccf61f93915c4a3275f553d709322cdc.tar.bz2 |
[Reader] Use std::optional in BitcodeReader.cpp (NFC)
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
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 198fe33..0b6c509 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -80,6 +80,7 @@ #include <deque> #include <map> #include <memory> +#include <optional> #include <set> #include <string> #include <system_error> @@ -593,7 +594,7 @@ class BitcodeReader : public BitcodeReaderBase, public GVMaterializer { /// ValueList must be destroyed before Alloc. BumpPtrAllocator Alloc; BitcodeReaderValueList ValueList; - Optional<MetadataLoader> MDLoader; + std::optional<MetadataLoader> MDLoader; std::vector<Comdat *> ComdatList; DenseSet<GlobalObject *> ImplicitComdatObjects; SmallVector<Instruction *, 64> InstructionList; @@ -3205,7 +3206,7 @@ Error BitcodeReader::parseConstants() { PointeeType = getTypeByID(Record[OpNum++]); bool InBounds = false; - Optional<unsigned> InRangeIndex; + std::optional<unsigned> InRangeIndex; if (BitCode == bitc::CST_CODE_CE_GEP_WITH_INRANGE_INDEX) { uint64_t Op = Record[OpNum++]; InBounds = Op & 1; |