[llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamReader.h

Chris Lattner sabre at nondot.org
Sun Apr 29 12:50:16 PDT 2007



Changes in directory llvm/include/llvm/Bitcode:

BitstreamReader.h updated: 1.7 -> 1.8
---
Log message:

compute this value correctly


---
Diffs of the changes:  (+4 -2)

 BitstreamReader.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Bitcode/BitstreamReader.h
diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.7 llvm/include/llvm/Bitcode/BitstreamReader.h:1.8
--- llvm/include/llvm/Bitcode/BitstreamReader.h:1.7	Sun Apr 29 14:17:32 2007
+++ llvm/include/llvm/Bitcode/BitstreamReader.h	Sun Apr 29 14:49:58 2007
@@ -48,9 +48,11 @@
   /// 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 @@
   
   /// 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);
   }
   
   






More information about the llvm-commits mailing list