Bitcode: Decouple block info block state from reader.
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 8 Nov 2016 04:17:11 +0000 (04:17 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 8 Nov 2016 04:17:11 +0000 (04:17 +0000)
commit77c89b6958f51a0b26c4849d37a200c1bc0319df
tree7ac81d7f4f32b81635db74539ad07fdbd1a6c535
parent939c7d916e1631cf2a005b4ba6c03726ecbe0f85
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<uint8_t>, so remove it and replace all uses with direct uses
of memory buffers.

Differential Revision: https://reviews.llvm.org/D26259

llvm-svn: 286207
15 files changed:
clang/include/clang/CodeGen/ObjectFilePCHContainerOperations.h
clang/include/clang/Frontend/PCHContainerOperations.h
clang/include/clang/Serialization/Module.h
clang/include/clang/Serialization/ModuleManager.h
clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
clang/lib/Frontend/PCHContainerOperations.cpp
clang/lib/Frontend/SerializedDiagnosticReader.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/GlobalModuleIndex.cpp
clang/lib/Serialization/ModuleManager.cpp
llvm/include/llvm/Bitcode/BitstreamReader.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Reader/BitstreamReader.cpp
llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
llvm/unittests/Bitcode/BitstreamReaderTest.cpp