mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Added methods to batch emit and deserialize owned pointers. This allows
to group the pointer IDs together in the bitstream before their referenced contents (which will lend itself to more efficient encoding). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43845 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -54,6 +54,36 @@ public:
|
||||
EmitPtr(ptr);
|
||||
if (ptr) SerializeTrait<T>::Emit(*this,*ptr);
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
void BatchEmitOwnedPtrs(T1* p1, T2* p2) {
|
||||
EmitPtr(p1);
|
||||
EmitPtr(p2);
|
||||
if (p1) SerializeTrait<T1>::Emit(*this,*p1);
|
||||
if (p2) SerializeTrait<T2>::Emit(*this,*p2);
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
void BatchEmitOwnedPtrs(T1* p1, T2* p2, T3* p3) {
|
||||
EmitPtr(p1);
|
||||
EmitPtr(p2);
|
||||
EmitPtr(p3);
|
||||
if (p1) SerializeTrait<T1>::Emit(*this,*p1);
|
||||
if (p2) SerializeTrait<T2>::Emit(*this,*p2);
|
||||
if (p3) SerializeTrait<T3>::Emit(*this,*p3);
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4>
|
||||
void BatchEmitOwnedPtrs(T1* p1, T2* p2, T3* p3, T4& p4) {
|
||||
EmitPtr(p1);
|
||||
EmitPtr(p2);
|
||||
EmitPtr(p3);
|
||||
EmitPtr(p4);
|
||||
if (p1) SerializeTrait<T1>::Emit(*this,*p1);
|
||||
if (p2) SerializeTrait<T2>::Emit(*this,*p2);
|
||||
if (p3) SerializeTrait<T3>::Emit(*this,*p3);
|
||||
if (p4) SerializeTrait<T4>::Emit(*this,*p4);
|
||||
}
|
||||
|
||||
void FlushRecord() { if (inRecord()) EmitRecord(); }
|
||||
|
||||
|
Reference in New Issue
Block a user