Added typedef "SerializedPtrID" to represent the pointer handle written to disk

instead of just using "unsigned".  This gives us more flexibility in changing
the definition of the handle later, and is more self-documenting.

Added tracking of block stack in the Deserializer.  Now clients can query
if they are still within a block using the methods GetCurrentBlockLocation()
and FinishedBlock().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43903 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek
2007-11-08 19:50:46 +00:00
parent b410df995c
commit ec8cd06555
5 changed files with 84 additions and 26 deletions

View File

@ -93,16 +93,17 @@ public:
for (unsigned i = 0; i < NumPtrs; ++i)
if (Ptrs[i]) SerializeTrait<T>::Emit(*this,*Ptrs[i]);
}
bool isRegistered(const void* p) const;
void FlushRecord() { if (inRecord()) EmitRecord(); }
void FlushRecord() { if (inRecord()) EmitRecord(); }
void EnterBlock(unsigned BlockID = 8, unsigned CodeLen = 3);
void ExitBlock();
private:
void EmitRecord();
inline bool inRecord() { return Record.size() > 0; }
unsigned getPtrId(const void* ptr);
SerializedPtrID getPtrId(const void* ptr);
};
} // end namespace llvm