mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Added version of BatchEmitOwnedPtrs and BatchReadOwnedPtrs that emits/reads
an array of pointers of the same type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -166,6 +166,18 @@ public:
|
||||
P3 = (ID3) ? SerializeTrait<T2>::Materialize(*this) : NULL;
|
||||
if (ID3 && A3) RegisterPtr(ID3,P3);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs) {
|
||||
llvm::SmallVector<unsigned,20> PtrIDs;
|
||||
PtrIDs.reserve(NumPtrs);
|
||||
|
||||
for (unsigned i = 0; i < NumPtrs; ++i)
|
||||
PtrIDs.push_back(ReadInt());
|
||||
|
||||
for (unsigned i = 0; i < NumPtrs; ++i)
|
||||
Ptrs[i] = PtrIDs[i] ? SerializeTrait<T>::Materialize(*this) : NULL;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
|
Reference in New Issue
Block a user