mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-21 18:26:41 +00:00
compute this value correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36575 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -48,9 +48,11 @@ class BitstreamReader {
|
|||||||
/// BlockScope - This tracks the codesize of parent blocks.
|
/// BlockScope - This tracks the codesize of parent blocks.
|
||||||
SmallVector<Block, 8> BlockScope;
|
SmallVector<Block, 8> BlockScope;
|
||||||
|
|
||||||
|
/// FirstChar - This remembers the first byte of the stream.
|
||||||
|
const unsigned char *FirstChar;
|
||||||
public:
|
public:
|
||||||
BitstreamReader(const unsigned char *Start, const unsigned char *End)
|
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");
|
assert(((End-Start) & 3) == 0 &&"Bitcode stream not a multiple of 4 bytes");
|
||||||
CurWord = 0;
|
CurWord = 0;
|
||||||
BitsInCurWord = 0;
|
BitsInCurWord = 0;
|
||||||
@@ -74,7 +76,7 @@ public:
|
|||||||
|
|
||||||
/// GetCurrentBitNo - Return the bit # of the bit we are reading.
|
/// GetCurrentBitNo - Return the bit # of the bit we are reading.
|
||||||
uint64_t GetCurrentBitNo() const {
|
uint64_t GetCurrentBitNo() const {
|
||||||
return CurWord * 32ULL + (32-CurCodeSize);
|
return (NextChar-FirstChar)*8 + (32-BitsInCurWord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user