From 77c89b6958f51a0b26c4849d37a200c1bc0319df Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 8 Nov 2016 04:17:11 +0000 Subject: Bitcode: Decouple block info block state from reader. As proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106630.html Move block info block state to a new class, BitstreamBlockInfo. Clients may set the block info for a particular cursor with the BitstreamCursor::setBlockInfo() method. At this point BitstreamReader is not much more than a container for an ArrayRef, so remove it and replace all uses with direct uses of memory buffers. Differential Revision: https://reviews.llvm.org/D26259 llvm-svn: 286207 --- clang/lib/Serialization/ModuleManager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'clang/lib/Serialization/ModuleManager.cpp') diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index 0a176f6..e50dcaa 100644 --- a/clang/lib/Serialization/ModuleManager.cpp +++ b/clang/lib/Serialization/ModuleManager.cpp @@ -135,15 +135,14 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type, } // Initialize the stream. - PCHContainerRdr.ExtractPCH(ModuleEntry->Buffer->getMemBufferRef(), - ModuleEntry->StreamFile); + ModuleEntry->Data = PCHContainerRdr.ExtractPCH(*ModuleEntry->Buffer); } if (ExpectedSignature) { // If we've not read the control block yet, read the signature eagerly now // so that we can check it. if (!ModuleEntry->Signature) - ModuleEntry->Signature = ReadSignature(ModuleEntry->StreamFile); + ModuleEntry->Signature = ReadSignature(ModuleEntry->Data); if (ModuleEntry->Signature != ExpectedSignature) { ErrorStr = ModuleEntry->Signature ? "signature mismatch" -- cgit v1.1