llvm.org GIT mirror llvm / 8d89f1f
add some helpers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36580 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
2 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
7878 return (NextChar-FirstChar)*8 + (32-BitsInCurWord);
7979 }
8080
81 /// GetAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
82 unsigned GetAbbrevIDWidth() const { return CurCodeSize; }
8183
8284 uint32_t Read(unsigned NumBits) {
8385 // If the field is fully contained by CurWord, return it quickly.
204206
205207 /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, read and enter
206208 /// the block, returning the BlockID of the block we just entered.
207 bool EnterSubBlock() {
209 bool EnterSubBlock(unsigned *NumWordsP = 0) {
208210 BlockScope.push_back(Block(CurCodeSize));
209211 BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
210212
212214 CurCodeSize = ReadVBR(bitc::CodeLenWidth);
213215 SkipToWord();
214216 unsigned NumWords = Read(bitc::BlockSizeWidth);
217 if (NumWordsP) *NumWordsP = NumWords;
215218
216219 // Validate that this block is sane.
217220 if (CurCodeSize == 0 || AtEndOfStream() || NextChar+NumWords*4 > LastChar)
9191
9292 // The constants block (CONSTANTS_BLOCK_ID) describes emission for each
9393 // constant and maintains an implicit current type value.
94 enum ConstantsSymtabCodes {
94 enum ConstantsCodes {
9595 CST_CODE_SETTYPE = 1, // SETTYPE: [typeid]
9696 CST_CODE_NULL = 2, // NULL
9797 CST_CODE_UNDEF = 3, // UNDEF