diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-26 20:59:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-26 20:59:02 +0000 |
commit | 962dde3cef3184f1683d5070c298c9a29509d62e (patch) | |
tree | 408bbdf7f92bb2a9e5490551f82d6ccdeb4ea0b3 /lib/Bitcode | |
parent | 3485d25a0e3355a13a9fe073fa5cd98838431ef0 (diff) | |
download | external_llvm-962dde3cef3184f1683d5070c298c9a29509d62e.zip external_llvm-962dde3cef3184f1683d5070c298c9a29509d62e.tar.gz external_llvm-962dde3cef3184f1683d5070c298c9a29509d62e.tar.bz2 |
Make a major API change to BitstreamReader: split all the reading
state out of the BitstreamReader class into a BitstreamCursor class.
Doing this allows the client to have multiple cursors into the same
file, each with potentially different live block stacks and
abbreviation records.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 3 | ||||
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.h | 3 | ||||
-rw-r--r-- | lib/Bitcode/Reader/Deserialize.cpp | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 8079acd..fe20f72 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1346,7 +1346,8 @@ bool BitcodeReader::ParseBitcode() { if (SkipBitcodeWrapperHeader(BufPtr, BufEnd)) return Error("Invalid bitcode wrapper header"); - Stream.init(BufPtr, BufEnd); + StreamFile.init(BufPtr, BufEnd); + Stream.init(StreamFile); // Sniff for the signature. if (Stream.Read(8) != 'B' || diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h index 1fbf219..0dc470b 100644 --- a/lib/Bitcode/Reader/BitcodeReader.h +++ b/lib/Bitcode/Reader/BitcodeReader.h @@ -86,7 +86,8 @@ public: class BitcodeReader : public ModuleProvider { MemoryBuffer *Buffer; - BitstreamReader Stream; + BitstreamReader StreamFile; + BitstreamCursor Stream; const char *ErrorString; diff --git a/lib/Bitcode/Reader/Deserialize.cpp b/lib/Bitcode/Reader/Deserialize.cpp index 2014557..06da6ce 100644 --- a/lib/Bitcode/Reader/Deserialize.cpp +++ b/lib/Bitcode/Reader/Deserialize.cpp @@ -22,7 +22,7 @@ using namespace llvm; Deserializer::Deserializer(BitstreamReader& stream) : Stream(stream), RecIdx(0), FreeList(NULL), AbbrevNo(0), RecordCode(0) { - StreamStart = Stream.GetCurrentBitNo(); + StreamStart = Stream.GetCurrentBitNo(); } Deserializer::~Deserializer() { |