mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
Added support in serializer and deserializer to create arbitrary blocks.
Added detection of end-of-stream in deserializer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43736 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -153,6 +153,8 @@ public:
|
||||
void RegisterPtr(const void* Ptr) {
|
||||
RegisterPtr(ReadInt(),Ptr);
|
||||
}
|
||||
|
||||
bool AtEnd();
|
||||
|
||||
private:
|
||||
void ReadRecord();
|
||||
|
@ -25,7 +25,7 @@ namespace llvm {
|
||||
class Serializer {
|
||||
BitstreamWriter& Stream;
|
||||
SmallVector<uint64_t,10> Record;
|
||||
bool inBlock;
|
||||
unsigned BlockLevel;
|
||||
|
||||
typedef DenseMap<const void*,unsigned> MapTy;
|
||||
MapTy PtrMap;
|
||||
@ -56,6 +56,9 @@ public:
|
||||
|
||||
void Flush() { if (inRecord()) EmitRecord(); }
|
||||
|
||||
void EnterBlock(unsigned BlockID = 8, unsigned CodeLen = 3);
|
||||
void ExitBlock();
|
||||
|
||||
private:
|
||||
void EmitRecord();
|
||||
inline bool inRecord() { return Record.size() > 0; }
|
||||
|
Reference in New Issue
Block a user