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.
This commit is contained in:
Bob Wilson
2016-11-17 17:22:27 -08:00
parent 6ca7872ba5
commit 343fe88f3a

View File

@@ -242,7 +242,7 @@ ValidationInfo serialization::validateSerializedAST(
llvm::BitstreamEntry topLevelEntry;
while (!cursor.AtEndOfStream()) {
topLevelEntry = cursor.advance();
topLevelEntry = cursor.advance(AF_DontPopBlockAtEnd);
if (topLevelEntry.Kind != llvm::BitstreamEntry::SubBlock)
break;
@@ -774,7 +774,7 @@ ModuleFile::ModuleFile(
llvm::BitstreamEntry topLevelEntry;
while (!cursor.AtEndOfStream()) {
topLevelEntry = cursor.advance();
topLevelEntry = cursor.advance(AF_DontPopBlockAtEnd);
if (topLevelEntry.Kind != llvm::BitstreamEntry::SubBlock)
break;
@@ -973,8 +973,6 @@ ModuleFile::ModuleFile(
}
break;
}
topLevelEntry = cursor.advance(AF_DontPopBlockAtEnd);
}
if (topLevelEntry.Kind != llvm::BitstreamEntry::EndBlock) {
@@ -993,7 +991,7 @@ ModuleFile::ModuleFile(
}
while (!docCursor.AtEndOfStream()) {
topLevelEntry = docCursor.advance();
topLevelEntry = docCursor.advance(AF_DontPopBlockAtEnd);
if (topLevelEntry.Kind != llvm::BitstreamEntry::SubBlock)
break;