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

Chris Lattner sabre at nondot.org
Sun Apr 29 14:49:22 PDT 2007



Changes in directory llvm/include/llvm/Bitcode:

BitstreamReader.h updated: 1.8 -> 1.9
LLVMBitCodes.h updated: 1.8 -> 1.9
---
Log message:

add some helpers


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

 BitstreamReader.h |    5 ++++-
 LLVMBitCodes.h    |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Bitcode/BitstreamReader.h
diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.8 llvm/include/llvm/Bitcode/BitstreamReader.h:1.9
--- llvm/include/llvm/Bitcode/BitstreamReader.h:1.8	Sun Apr 29 14:49:58 2007
+++ llvm/include/llvm/Bitcode/BitstreamReader.h	Sun Apr 29 16:49:05 2007
@@ -79,6 +79,8 @@
     return (NextChar-FirstChar)*8 + (32-BitsInCurWord);
   }
   
+  /// GetAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
+  unsigned GetAbbrevIDWidth() const { return CurCodeSize; }
   
   uint32_t Read(unsigned NumBits) {
     // If the field is fully contained by CurWord, return it quickly.
@@ -205,7 +207,7 @@
   
   /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, read and enter
   /// the block, returning the BlockID of the block we just entered.
-  bool EnterSubBlock() {
+  bool EnterSubBlock(unsigned *NumWordsP = 0) {
     BlockScope.push_back(Block(CurCodeSize));
     BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
     
@@ -213,6 +215,7 @@
     CurCodeSize = ReadVBR(bitc::CodeLenWidth);
     SkipToWord();
     unsigned NumWords = Read(bitc::BlockSizeWidth);
+    if (NumWordsP) *NumWordsP = NumWords;
     
     // Validate that this block is sane.
     if (CurCodeSize == 0 || AtEndOfStream() || NextChar+NumWords*4 > LastChar)


Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h
diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.8 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.9
--- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.8	Thu Apr 26 00:53:04 2007
+++ llvm/include/llvm/Bitcode/LLVMBitCodes.h	Sun Apr 29 16:49:05 2007
@@ -92,7 +92,7 @@
   
   // The constants block (CONSTANTS_BLOCK_ID) describes emission for each
   // constant and maintains an implicit current type value.
-  enum ConstantsSymtabCodes {
+  enum ConstantsCodes {
     CST_CODE_SETTYPE       =  1,  // SETTYPE:       [typeid]
     CST_CODE_NULL          =  2,  // NULL
     CST_CODE_UNDEF         =  3,  // UNDEF






More information about the llvm-commits mailing list