diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-11-07 23:18:40 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-11-07 23:18:40 +0000 |
commit | fba9cdaa81e9e08ad4194acbff102586cf0838c5 (patch) | |
tree | 40b9661e7e07b83e8a35ec3bb80d733ea89ce46f /include/llvm/Bitcode/Deserialize.h | |
parent | 6d8ab4ae81f0dd8ac80f25b31a3a1eff55126121 (diff) |
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
Diffstat (limited to 'include/llvm/Bitcode/Deserialize.h')
-rw-r--r-- | include/llvm/Bitcode/Deserialize.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Bitcode/Deserialize.h b/include/llvm/Bitcode/Deserialize.h index e77c6c9fa7..5f8e137559 100644 --- a/include/llvm/Bitcode/Deserialize.h +++ b/include/llvm/Bitcode/Deserialize.h @@ -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> |