llvm.org GIT mirror llvm / 13faf5c
Made Deserializer a friend class of BitstreamReader. Moved some of the logic in BitstreamReader::ExitBlock into a utility function BitstreamReader::PopBlockScope. The latter is a private method. It will also be called by Deserializer to manipulate the current "block scope." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43972 91177308-0d34-0410-b5e6-96231b3b80d8 Ted Kremenek 12 years ago
1 changed file(s) with 14 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
1919
2020 namespace llvm {
2121
22 class Deserializer;
23
2224 class BitstreamReader {
2325 const unsigned char *NextChar;
2426 const unsigned char *LastChar;
27 friend class Deserializer;
2528
2629 /// CurWord - This is the current data we have pulled from the stream but have
2730 /// not returned to the client.
268271 return false;
269272 }
270273
271 /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, read and enter
272 /// the block, returning the BlockID of the block we just entered.
274 /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, enter
275 /// the block, and return true if the block is valid.
273276 bool EnterSubBlock(unsigned BlockID, unsigned *NumWordsP = 0) {
274277 // Save the current block's state on BlockScope.
275278 BlockScope.push_back(Block(CurCodeSize));
302305 // Block tail:
303306 // [END_BLOCK, ]
304307 SkipToWord();
308
309 PopBlockScope();
310 return false;
311 }
312
313 private:
314 void PopBlockScope() {
305315 CurCodeSize = BlockScope.back().PrevCodeSize;
306316
307317 // Delete abbrevs from popped scope.
310320
311321 BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
312322 BlockScope.pop_back();
313 return false;
314 }
315
323 }
324
316325 //===--------------------------------------------------------------------===//
317326 // Record Processing
318327 //===--------------------------------------------------------------------===//