Skip to content

Commit 343fe88

Browse files
committed
Fix up compnerd's change 46d684f to stop using BitstreamReader.
The more important fix here is to remove a duplicated call to advance the cursor, which led to module import being completely broken. I also added back the AF_DontPopBlockAtEnd flags that were dropped. I am not certain if they are needed but without clear indication otherwise, we should keep them.
1 parent 6ca7872 commit 343fe88

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Serialization/ModuleFile.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ ValidationInfo serialization::validateSerializedAST(
242242
llvm::BitstreamEntry topLevelEntry;
243243

244244
while (!cursor.AtEndOfStream()) {
245-
topLevelEntry = cursor.advance();
245+
topLevelEntry = cursor.advance(AF_DontPopBlockAtEnd);
246246
if (topLevelEntry.Kind != llvm::BitstreamEntry::SubBlock)
247247
break;
248248

@@ -774,7 +774,7 @@ ModuleFile::ModuleFile(
774774
llvm::BitstreamEntry topLevelEntry;
775775

776776
while (!cursor.AtEndOfStream()) {
777-
topLevelEntry = cursor.advance();
777+
topLevelEntry = cursor.advance(AF_DontPopBlockAtEnd);
778778
if (topLevelEntry.Kind != llvm::BitstreamEntry::SubBlock)
779779
break;
780780

@@ -973,8 +973,6 @@ ModuleFile::ModuleFile(
973973
}
974974
break;
975975
}
976-
977-
topLevelEntry = cursor.advance(AF_DontPopBlockAtEnd);
978976
}
979977

980978
if (topLevelEntry.Kind != llvm::BitstreamEntry::EndBlock) {
@@ -993,7 +991,7 @@ ModuleFile::ModuleFile(
993991
}
994992

995993
while (!docCursor.AtEndOfStream()) {
996-
topLevelEntry = docCursor.advance();
994+
topLevelEntry = docCursor.advance(AF_DontPopBlockAtEnd);
997995
if (topLevelEntry.Kind != llvm::BitstreamEntry::SubBlock)
998996
break;
999997

0 commit comments

Comments
 (0)