Author: kremenek Date: Fri Nov 9 20:00:38 2007 New Revision: 43972 URL: http://llvm.org/viewvc/llvm-project?rev=43972&view=rev Log: 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." 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=43972&r1=43971&r2=43972&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/BitstreamReader.h (original) +++ llvm/trunk/include/llvm/Bitcode/BitstreamReader.h Fri Nov 9 20:00:38 2007 @@ -20,9 +20,12 @@ namespace llvm { + class Deserializer; + class BitstreamReader { const unsigned char *NextChar; const unsigned char *LastChar; + friend class Deserializer; /// CurWord - This is the current data we have pulled from the stream but have /// not returned to the client. @@ -269,8 +272,8 @@ return false; } - /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, read and enter - /// the block, returning the BlockID of the block we just entered. + /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, enter + /// the block, and return true if the block is valid. bool EnterSubBlock(unsigned BlockID, unsigned *NumWordsP = 0) { // Save the current block's state on BlockScope. BlockScope.push_back(Block(CurCodeSize)); @@ -303,6 +306,13 @@ // Block tail: // [END_BLOCK, <align4bytes>] SkipToWord(); + + PopBlockScope(); + return false; + } + +private: + void PopBlockScope() { CurCodeSize = BlockScope.back().PrevCodeSize; // Delete abbrevs from popped scope. @@ -311,9 +321,8 @@ BlockScope.back().PrevAbbrevs.swap(CurAbbrevs); BlockScope.pop_back(); - return false; - } - + } + //===--------------------------------------------------------------------===// // Record Processing //===--------------------------------------------------------------------===// _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits