Updated Deserializer class to provide more information about the current

block that is being visited in the bitstream.  The client can also now
skip blocks before reading them, and query the current abbreviation number
as seen from the perspective of the Deserializer.  This allows the client
to be more interactive in the deserialization process (if they so choose).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43916 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek
2007-11-09 00:43:51 +00:00
parent dbaf378350
commit 48a396948f
2 changed files with 115 additions and 56 deletions

View File

@ -88,12 +88,14 @@ public:
private:
BitstreamReader& Stream;
SmallVector<uint64_t,10> Record;
SmallVector<uint64_t,20> Record;
unsigned RecIdx;
BumpPtrAllocator Allocator;
BPNode* FreeList;
MapTy BPatchMap;
llvm::SmallVector<uint64_t,5> BlockLocs;
llvm::SmallVector<std::pair<Location,unsigned>,5> BlockStack;
unsigned AbbrevNo;
unsigned RecordCode;
//===----------------------------------------------------------===//
// Public Interface.
@ -231,14 +233,22 @@ public:
RegisterPtr(PtrID,&x);
}
Location GetCurrentBlockLocation();
Location getCurrentBlockLocation();
unsigned getCurrentBlockID();
unsigned getAbbrevNo();
bool FinishedBlock(Location BlockLoc);
bool AtEnd();
bool inRecord();
void SkipBlock();
unsigned getRecordCode();
private:
void ReadRecord();
bool AdvanceStream();
void ReadRecord();
uintptr_t ReadInternalRefPtr();
static inline bool HasFinalPtr(MapTy::value_type& V) {