summaryrefslogtreecommitdiff
path: root/lib/Serialization/GlobalModuleIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r--lib/Serialization/GlobalModuleIndex.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp
index 581e894d9150..9f986d54a989 100644
--- a/lib/Serialization/GlobalModuleIndex.cpp
+++ b/lib/Serialization/GlobalModuleIndex.cpp
@@ -245,12 +245,8 @@ GlobalModuleIndex::readIndex(StringRef Path) {
return std::make_pair(nullptr, EC_NotFound);
std::unique_ptr<llvm::MemoryBuffer> Buffer = std::move(BufferOrErr.get());
- /// \brief The bitstream reader from which we'll read the AST file.
- llvm::BitstreamReader Reader((const unsigned char *)Buffer->getBufferStart(),
- (const unsigned char *)Buffer->getBufferEnd());
-
/// \brief The main bitstream cursor for the main block.
- llvm::BitstreamCursor Cursor(Reader);
+ llvm::BitstreamCursor Cursor(*Buffer);
// Sniff for the signature.
if (Cursor.Read(8) != 'B' ||
@@ -460,7 +456,7 @@ static void emitRecordID(unsigned ID, const char *Name,
void
GlobalModuleIndexBuilder::emitBlockInfoBlock(llvm::BitstreamWriter &Stream) {
SmallVector<uint64_t, 64> Record;
- Stream.EnterSubblock(llvm::bitc::BLOCKINFO_BLOCK_ID, 3);
+ Stream.EnterBlockInfoBlock();
#define BLOCK(X) emitBlockID(X ## _ID, #X, Stream, Record)
#define RECORD(X) emitRecordID(X, #X, Stream, Record)
@@ -504,9 +500,7 @@ bool GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) {
}
// Initialize the input stream
- llvm::BitstreamReader InStreamFile;
- PCHContainerRdr.ExtractPCH((*Buffer)->getMemBufferRef(), InStreamFile);
- llvm::BitstreamCursor InStream(InStreamFile);
+ llvm::BitstreamCursor InStream(PCHContainerRdr.ExtractPCH(**Buffer));
// Sniff for the signature.
if (InStream.Read(8) != 'C' ||