[llvm-commits] [llvm] r68648 - /llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
Douglas Gregor
dgregor at apple.com
Wed Apr 8 15:26:47 PDT 2009
Author: dgregor
Date: Wed Apr 8 17:26:47 2009
New Revision: 68648
URL: http://llvm.org/viewvc/llvm-project?rev=68648&view=rev
Log:
Fix BitstreamReader's GetCurrentBitNo to return the correct bit number, and stop JumpToBit from covering up its mistakes
Modified:
llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
Modified: llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamReader.h?rev=68648&r1=68647&r2=68648&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/BitstreamReader.h (original)
+++ llvm/trunk/include/llvm/Bitcode/BitstreamReader.h Wed Apr 8 17:26:47 2009
@@ -115,7 +115,7 @@
/// GetCurrentBitNo - Return the bit # of the bit we are reading.
uint64_t GetCurrentBitNo() const {
- return (NextChar-FirstChar)*CHAR_BIT + ((32-BitsInCurWord) & 31);
+ return (NextChar-FirstChar)*CHAR_BIT - BitsInCurWord;
}
/// JumpToBit - Reset the stream to the specified bit number.
@@ -131,7 +131,6 @@
// Skip over any bits that are already consumed.
if (WordBitNo) {
- NextChar -= 4;
Read(static_cast<unsigned>(WordBitNo));
}
}
More information about the llvm-commits
mailing list