aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Bitstream/Reader/BitstreamReader.cpp')
-rw-r--r--llvm/lib/Bitstream/Reader/BitstreamReader.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
index c297e16..a3e37c6 100644
--- a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
+++ b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
@@ -438,7 +438,7 @@ BitstreamCursor::ReadBlockInfoBlock(bool ReadBlockInfoNames) {
switch (Entry.Kind) {
case llvm::BitstreamEntry::SubBlock: // Handled for us already.
case llvm::BitstreamEntry::Error:
- return None;
+ return std::nullopt;
case llvm::BitstreamEntry::EndBlock:
return std::move(NewBlockInfo);
case llvm::BitstreamEntry::Record:
@@ -448,7 +448,8 @@ BitstreamCursor::ReadBlockInfoBlock(bool ReadBlockInfoNames) {
// Read abbrev records, associate them with CurBID.
if (Entry.ID == bitc::DEFINE_ABBREV) {
- if (!CurBlockInfo) return None;
+ if (!CurBlockInfo)
+ return std::nullopt;
if (Error Err = ReadAbbrevRecord())
return std::move(Err);
@@ -469,24 +470,25 @@ BitstreamCursor::ReadBlockInfoBlock(bool ReadBlockInfoNames) {
break; // Default behavior, ignore unknown content.
case bitc::BLOCKINFO_CODE_SETBID:
if (Record.size() < 1)
- return None;
+ return std::nullopt;
CurBlockInfo = &NewBlockInfo.getOrCreateBlockInfo((unsigned)Record[0]);
break;
case bitc::BLOCKINFO_CODE_BLOCKNAME: {
if (!CurBlockInfo)
- return None;
+ return std::nullopt;
if (!ReadBlockInfoNames)
break; // Ignore name.
CurBlockInfo->Name = std::string(Record.begin(), Record.end());
break;
}
case bitc::BLOCKINFO_CODE_SETRECORDNAME: {
- if (!CurBlockInfo) return None;
- if (!ReadBlockInfoNames)
- break; // Ignore name.
- CurBlockInfo->RecordNames.emplace_back(
- (unsigned)Record[0], std::string(Record.begin() + 1, Record.end()));
- break;
+ if (!CurBlockInfo)
+ return std::nullopt;
+ if (!ReadBlockInfoNames)
+ break; // Ignore name.
+ CurBlockInfo->RecordNames.emplace_back(
+ (unsigned)Record[0], std::string(Record.begin() + 1, Record.end()));
+ break;
}
}
}