diff options
author | Chris Lattner <sabre@nondot.org> | 2007-04-29 19:49:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-04-29 19:49:58 +0000 |
commit | e2ea46d50b995acc61eb24ec6eafc356b8c2832a (patch) | |
tree | e1dc091aed90b112875a3e0d95497560921554b8 | |
parent | 4a00cf3fc463149c9dc30fdd9afb87ce3ac6a700 (diff) | |
download | bcm5719-llvm-e2ea46d50b995acc61eb24ec6eafc356b8c2832a.tar.gz bcm5719-llvm-e2ea46d50b995acc61eb24ec6eafc356b8c2832a.zip |
compute this value correctly
llvm-svn: 36575
-rw-r--r-- | llvm/include/llvm/Bitcode/BitstreamReader.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/include/llvm/Bitcode/BitstreamReader.h b/llvm/include/llvm/Bitcode/BitstreamReader.h index f41c4f0ec3b..c6394b6c99a 100644 --- a/llvm/include/llvm/Bitcode/BitstreamReader.h +++ b/llvm/include/llvm/Bitcode/BitstreamReader.h @@ -48,9 +48,11 @@ class BitstreamReader { /// BlockScope - This tracks the codesize of parent blocks. SmallVector<Block, 8> BlockScope; + /// FirstChar - This remembers the first byte of the stream. + const unsigned char *FirstChar; public: BitstreamReader(const unsigned char *Start, const unsigned char *End) - : NextChar(Start), LastChar(End) { + : NextChar(Start), LastChar(End), FirstChar(Start) { assert(((End-Start) & 3) == 0 &&"Bitcode stream not a multiple of 4 bytes"); CurWord = 0; BitsInCurWord = 0; @@ -74,7 +76,7 @@ public: /// GetCurrentBitNo - Return the bit # of the bit we are reading. uint64_t GetCurrentBitNo() const { - return CurWord * 32ULL + (32-CurCodeSize); + return (NextChar-FirstChar)*8 + (32-BitsInCurWord); } |