llvm.org GIT mirror llvm / 3ba3a9b
Renamed serialization method "Materialize" to "Create". This is an API change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44034 91177308-0d34-0410-b5e6-96231b3b80d8 Ted Kremenek 12 years ago
2 changed file(s) with 15 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
151151 }
152152
153153 template
154 inline T* Materialize() {
155 return SerializeTrait::Materialize(*this);
154 inline T* Create() {
155 return SerializeTrait::Create(*this);
156156 }
157157
158158 char* ReadCStr(char* cstr = NULL, unsigned MaxLen=0, bool isNullTerm=true);
165165 if (!PtrID)
166166 return NULL;
167167
168 T* x = SerializeTrait::Materialize(*this);
168 T* x = SerializeTrait::Create(*this);
169169
170170 if (AutoRegister)
171171 RegisterPtr(PtrID,x);
185185 SerializedPtrID ID1 = ReadPtrID();
186186 SerializedPtrID ID2 = ReadPtrID();
187187
188 P1 = (ID1) ? SerializeTrait::Materialize(*this) : NULL;
188 P1 = (ID1) ? SerializeTrait::Create(*this) : NULL;
189189 if (ID1 && A1) RegisterPtr(ID1,P1);
190190
191 P2 = (ID2) ? SerializeTrait::Materialize(*this) : NULL;
191 P2 = (ID2) ? SerializeTrait::Create(*this) : NULL;
192192 if (ID2 && A2) RegisterPtr(ID2,P2);
193193 }
194194
200200 SerializedPtrID ID2 = ReadPtrID();
201201 SerializedPtrID ID3 = ReadPtrID();
202202
203 P1 = (ID1) ? SerializeTrait::Materialize(*this) : NULL;
203 P1 = (ID1) ? SerializeTrait::Create(*this) : NULL;
204204 if (ID1 && A1) RegisterPtr(ID1,P1);
205205
206 P2 = (ID2) ? SerializeTrait::Materialize(*this) : NULL;
206 P2 = (ID2) ? SerializeTrait::Create(*this) : NULL;
207207 if (ID2 && A2) RegisterPtr(ID2,P2);
208208
209 P3 = (ID3) ? SerializeTrait::Materialize(*this) : NULL;
209 P3 = (ID3) ? SerializeTrait::Create(*this) : NULL;
210210 if (ID3 && A3) RegisterPtr(ID3,P3);
211211 }
212212
220220 for (unsigned i = 0; i < NumPtrs; ++i) {
221221 SerializedPtrID& PtrID = BatchIDVec[i];
222222
223 T* p = PtrID ? SerializeTrait::Materialize(*this) : NULL;
223 T* p = PtrID ? SerializeTrait::Create(*this) : NULL;
224224
225225 if (PtrID && AutoRegister)
226226 RegisterPtr(PtrID,p);
245245 for (unsigned i = 0; i < NumT1Ptrs; ++i) {
246246 SerializedPtrID& PtrID = BatchIDVec[i];
247247
248 T1* p = PtrID ? SerializeTrait::Materialize(*this) : NULL;
248 T1* p = PtrID ? SerializeTrait::Create(*this) : NULL;
249249
250250 if (PtrID && A1)
251251 RegisterPtr(PtrID,p);
253253 Ptrs[i] = p;
254254 }
255255
256 P2 = (ID2) ? SerializeTrait::Materialize(*this) : NULL;
256 P2 = (ID2) ? SerializeTrait::Create(*this) : NULL;
257257 if (ID2 && A2) RegisterPtr(ID2,P2);
258258
259 P3 = (ID3) ? SerializeTrait::Materialize(*this) : NULL;
259 P3 = (ID3) ? SerializeTrait::Create(*this) : NULL;
260260 if (ID3 && A3) RegisterPtr(ID3,P3);
261261 }
262262
272272
273273
274274 template
275 void ReadPtr(T*& PtrRef, const SerializedPtrID& PtrID, bool AllowBackpatch = true) {
275 void ReadPtr(T*& PtrRef, const SerializedPtrID& PtrID,
276 bool AllowBackpatch = true) {
276277 ReadUIntPtr(reinterpret_cast(PtrRef), PtrID, AllowBackpatch);
277278 }
278279
3636 struct SerializeTrait {
3737 static inline void Emit(Serializer& S, const T& X) { X.Emit(S); }
3838 static inline void Read(Deserializer& D, T& X) { X.Read(D); }
39 static inline T* Materialize(Deserializer& D) { return T::Materialize(D); }
39 static inline T* Create(Deserializer& D) { return T::Create(D); }
4040 };
4141
4242 #define SERIALIZE_INT_TRAIT(TYPE)\