ASTConsumer *Consumer;
/// \brief The bitstream reader from which we'll read the PCH file.
- llvm::BitstreamReader Stream;
+ llvm::BitstreamReader StreamFile;
+ llvm::BitstreamCursor Stream;
/// \brief The file name of the PCH file.
std::string FileName;
Sema *getSema() { return SemaObj; }
/// \brief Retrieve the stream that this PCH reader is reading from.
- llvm::BitstreamReader &getStream() { return Stream; }
+ llvm::BitstreamCursor &getStream() { return Stream; }
/// \brief Retrieve the identifier table associated with the
/// preprocessor.
/// \brief Helper class that saves the current stream position and
/// then restores it when destroyed.
struct VISIBILITY_HIDDEN SavedStreamPosition {
- explicit SavedStreamPosition(llvm::BitstreamReader &Stream)
- : Stream(Stream), Offset(Stream.GetCurrentBitNo()) { }
+ explicit SavedStreamPosition(llvm::BitstreamCursor &Cursor)
+ : Cursor(Cursor), Offset(Cursor.GetCurrentBitNo()) { }
~SavedStreamPosition() {
- Stream.JumpToBit(Offset);
+ Cursor.JumpToBit(Offset);
}
private:
- llvm::BitstreamReader &Stream;
+ llvm::BitstreamCursor &Cursor;
uint64_t Offset;
};
}
}
// Initialize the stream
- Stream.init((const unsigned char *)Buffer->getBufferStart(),
- (const unsigned char *)Buffer->getBufferEnd());
+ StreamFile.init((const unsigned char *)Buffer->getBufferStart(),
+ (const unsigned char *)Buffer->getBufferEnd());
+ Stream.init(StreamFile);
// Sniff for the signature.
if (Stream.Read(8) != 'C' ||