llvm.org GIT mirror llvm / fba9cda
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 Ted Kremenek 12 years ago
2 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
165165 P3 = (ID3) ? SerializeTrait::Materialize(*this) : NULL;
166166 if (ID3 && A3) RegisterPtr(ID3,P3);
167167 }
168
169 template
170 void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs) {
171 llvm::SmallVector PtrIDs;
172 PtrIDs.reserve(NumPtrs);
173
174 for (unsigned i = 0; i < NumPtrs; ++i)
175 PtrIDs.push_back(ReadInt());
176
177 for (unsigned i = 0; i < NumPtrs; ++i)
178 Ptrs[i] = PtrIDs[i] ? SerializeTrait::Materialize(*this) : NULL;
179 }
168180
169181
170182 template
8484 if (p4) SerializeTrait::Emit(*this,*p4);
8585 }
8686
87 template
88 void BatchEmitOwnedPtrs(unsigned NumPtrs, T** Ptrs) {
89 for (unsigned i = 0; i < NumPtrs; ++i)
90 EmitPtr(Ptrs[i]);
91
92 for (unsigned i = 0; i < NumPtrs; ++i)
93 if (Ptrs[i]) SerializeTrait::Emit(*this,Ptrs[i]);
94 }
95
8796 void FlushRecord() { if (inRecord()) EmitRecord(); }
8897
8998 void EnterBlock(unsigned BlockID = 8, unsigned CodeLen = 3);