/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===- TypeRecordMapping.cpp ------------------------------------*- C++ -*-===// |
2 | | // |
3 | | // The LLVM Compiler Infrastructure |
4 | | // |
5 | | // This file is distributed under the University of Illinois Open Source |
6 | | // License. See LICENSE.TXT for details. |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | |
10 | | #include "llvm/DebugInfo/CodeView/TypeRecordMapping.h" |
11 | | |
12 | | using namespace llvm; |
13 | | using namespace llvm::codeview; |
14 | | |
15 | | #define error(X) \ |
16 | 111k | if (auto 1.11k EC111k = X1.30k ) \ TypeRecordMapping.cpp:llvm::codeview::TypeRecordMapping::visitKnownRecord(llvm::codeview::CVRecord<llvm::codeview::TypeLeafKind>&, llvm::codeview::ArgListRecord&)::$_0::operator()(llvm::codeview::CodeViewRecordIO&, llvm::codeview::TypeIndex&) const Line | Count | Source | 16 | 862 | if (auto EC = X) \ |
TypeRecordMapping.cpp:llvm::codeview::TypeRecordMapping::visitKnownRecord(llvm::codeview::CVRecord<llvm::codeview::TypeLeafKind>&, llvm::codeview::StringListRecord&)::$_1::operator()(llvm::codeview::CodeViewRecordIO&, llvm::codeview::TypeIndex&) const Line | Count | Source | 16 | 76 | if (auto EC = X) \ |
TypeRecordMapping.cpp:llvm::codeview::TypeRecordMapping::visitKnownRecord(llvm::codeview::CVRecord<llvm::codeview::TypeLeafKind>&, llvm::codeview::VFTableRecord&)::$_2::operator()(llvm::codeview::CodeViewRecordIO&, llvm::StringRef&) const Line | Count | Source | 16 | 30 | if (auto EC = X) \ |
TypeRecordMapping.cpp:llvm::codeview::TypeRecordMapping::visitKnownRecord(llvm::codeview::CVRecord<llvm::codeview::TypeLeafKind>&, llvm::codeview::BuildInfoRecord&)::$_3::operator()(llvm::codeview::CodeViewRecordIO&, llvm::codeview::TypeIndex&) const Line | Count | Source | 16 | 336 | if (auto EC = X) \ |
|
17 | 111k | return EC; |
18 | | |
19 | | namespace { |
20 | | struct MapOneMethodRecord { |
21 | | explicit MapOneMethodRecord(bool IsFromOverloadList) |
22 | 347 | : IsFromOverloadList(IsFromOverloadList) {} |
23 | | |
24 | 598 | Error operator()(CodeViewRecordIO &IO, OneMethodRecord &Method) const { |
25 | 598 | error598 (IO.mapInteger(Method.Attrs.Attrs)); |
26 | 598 | if (IsFromOverloadList598 ) { |
27 | 436 | uint16_t Padding = 0; |
28 | 436 | error436 (IO.mapInteger(Padding)); |
29 | 436 | } |
30 | 598 | error598 (IO.mapInteger(Method.Type))598 ; |
31 | 598 | if (Method.isIntroducingVirtual()598 ) { |
32 | 39 | error39 (IO.mapInteger(Method.VFTableOffset)); |
33 | 598 | } else if (559 !IO.isWriting()559 ) |
34 | 460 | Method.VFTableOffset = -1; |
35 | 598 | |
36 | 598 | if (598 !IsFromOverloadList598 ) |
37 | 598 | error162 (IO.mapStringZ(Method.Name)); |
38 | 598 | |
39 | 598 | return Error::success(); |
40 | 598 | } |
41 | | |
42 | | private: |
43 | | bool IsFromOverloadList; |
44 | | }; |
45 | | } |
46 | | |
47 | | static Error mapNameAndUniqueName(CodeViewRecordIO &IO, StringRef &Name, |
48 | 1.28k | StringRef &UniqueName, bool HasUniqueName) { |
49 | 1.28k | if (IO.isWriting()1.28k ) { |
50 | 242 | // Try to be smart about what we write here. We can't write anything too |
51 | 242 | // large, so if we're going to go over the limit, truncate both the name |
52 | 242 | // and unique name by the same amount. |
53 | 242 | size_t BytesLeft = IO.maxFieldLength(); |
54 | 242 | if (HasUniqueName242 ) { |
55 | 186 | size_t BytesNeeded = Name.size() + UniqueName.size() + 2; |
56 | 186 | StringRef N = Name; |
57 | 186 | StringRef U = UniqueName; |
58 | 186 | if (BytesNeeded > BytesLeft186 ) { |
59 | 3 | size_t BytesToDrop = (BytesNeeded - BytesLeft); |
60 | 3 | size_t DropN = std::min(N.size(), BytesToDrop / 2); |
61 | 3 | size_t DropU = std::min(U.size(), BytesToDrop - DropN); |
62 | 3 | |
63 | 3 | N = N.drop_back(DropN); |
64 | 3 | U = U.drop_back(DropU); |
65 | 3 | } |
66 | 186 | |
67 | 186 | error186 (IO.mapStringZ(N)); |
68 | 186 | error186 (IO.mapStringZ(U)); |
69 | 242 | } else { |
70 | 56 | // Cap the length of the string at however many bytes we have available, |
71 | 56 | // plus one for the required null terminator. |
72 | 56 | auto N = StringRef(Name).take_front(BytesLeft - 1); |
73 | 56 | error56 (IO.mapStringZ(N)); |
74 | 56 | } |
75 | 1.28k | } else { |
76 | 1.03k | error1.03k (IO.mapStringZ(Name)); |
77 | 1.03k | if (HasUniqueName) |
78 | 1.03k | error949 (IO.mapStringZ(UniqueName)); |
79 | 1.03k | } |
80 | 1.28k | |
81 | 1.28k | return Error::success(); |
82 | 1.28k | } |
83 | | |
84 | 7.17k | Error TypeRecordMapping::visitTypeBegin(CVType &CVR) { |
85 | 7.17k | assert(!TypeKind.hasValue() && "Already in a type mapping!"); |
86 | 7.17k | assert(!MemberKind.hasValue() && "Already in a member mapping!"); |
87 | 7.17k | |
88 | 7.17k | // FieldList and MethodList records can be any length because they can be |
89 | 7.17k | // split with continuation records. All other record types cannot be |
90 | 7.17k | // longer than the maximum record length. |
91 | 7.17k | Optional<uint32_t> MaxLen; |
92 | 7.17k | if (CVR.Type != TypeLeafKind::LF_FIELDLIST && |
93 | 6.22k | CVR.Type != TypeLeafKind::LF_METHODLIST) |
94 | 6.03k | MaxLen = MaxRecordLength - sizeof(RecordPrefix); |
95 | 7.17k | error7.17k (IO.beginRecord(MaxLen)); |
96 | 7.17k | TypeKind = CVR.Type; |
97 | 7.17k | return Error::success(); |
98 | 7.17k | } |
99 | | |
100 | 7.17k | Error TypeRecordMapping::visitTypeEnd(CVType &Record) { |
101 | 7.17k | assert(TypeKind.hasValue() && "Not in a type mapping!"); |
102 | 7.17k | assert(!MemberKind.hasValue() && "Still in a member mapping!"); |
103 | 7.17k | |
104 | 7.17k | error7.17k (IO.endRecord()); |
105 | 7.17k | |
106 | 7.17k | TypeKind.reset(); |
107 | 7.17k | return Error::success(); |
108 | 7.17k | } |
109 | | |
110 | 13.6k | Error TypeRecordMapping::visitMemberBegin(CVMemberRecord &Record) { |
111 | 13.6k | assert(TypeKind.hasValue() && "Not in a type mapping!"); |
112 | 13.6k | assert(!MemberKind.hasValue() && "Already in a member mapping!"); |
113 | 13.6k | |
114 | 13.6k | // The largest possible subrecord is one in which there is a record prefix, |
115 | 13.6k | // followed by the subrecord, followed by a continuation, and that entire |
116 | 13.6k | // sequence spaws `MaxRecordLength` bytes. So the record's length is |
117 | 13.6k | // calculated as follows. |
118 | 13.6k | constexpr uint32_t ContinuationLength = 8; |
119 | 13.6k | error(IO.beginRecord(MaxRecordLength - sizeof(RecordPrefix) - |
120 | 13.6k | ContinuationLength)); |
121 | 13.6k | |
122 | 13.6k | MemberKind = Record.Kind; |
123 | 13.6k | return Error::success(); |
124 | 13.6k | } |
125 | | |
126 | 13.6k | Error TypeRecordMapping::visitMemberEnd(CVMemberRecord &Record) { |
127 | 13.6k | assert(TypeKind.hasValue() && "Not in a type mapping!"); |
128 | 13.6k | assert(MemberKind.hasValue() && "Not in a member mapping!"); |
129 | 13.6k | |
130 | 13.6k | if (!IO.isWriting()13.6k ) { |
131 | 7.44k | if (auto EC = IO.skipPadding()) |
132 | 0 | return EC; |
133 | 13.6k | } |
134 | 13.6k | |
135 | 13.6k | MemberKind.reset(); |
136 | 13.6k | error13.6k (IO.endRecord()); |
137 | 13.6k | return Error::success(); |
138 | 13.6k | } |
139 | | |
140 | 151 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ModifierRecord &Record) { |
141 | 151 | error151 (IO.mapInteger(Record.ModifiedType)); |
142 | 151 | error151 (IO.mapEnum(Record.Modifiers)); |
143 | 151 | |
144 | 151 | return Error::success(); |
145 | 151 | } |
146 | | |
147 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
148 | 471 | ProcedureRecord &Record) { |
149 | 471 | error471 (IO.mapInteger(Record.ReturnType)); |
150 | 471 | error471 (IO.mapEnum(Record.CallConv)); |
151 | 471 | error471 (IO.mapEnum(Record.Options)); |
152 | 471 | error471 (IO.mapInteger(Record.ParameterCount)); |
153 | 471 | error471 (IO.mapInteger(Record.ArgumentList)); |
154 | 471 | |
155 | 471 | return Error::success(); |
156 | 471 | } |
157 | | |
158 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
159 | 667 | MemberFunctionRecord &Record) { |
160 | 667 | error667 (IO.mapInteger(Record.ReturnType)); |
161 | 667 | error667 (IO.mapInteger(Record.ClassType)); |
162 | 667 | error667 (IO.mapInteger(Record.ThisType)); |
163 | 667 | error667 (IO.mapEnum(Record.CallConv)); |
164 | 667 | error667 (IO.mapEnum(Record.Options)); |
165 | 667 | error667 (IO.mapInteger(Record.ParameterCount)); |
166 | 667 | error667 (IO.mapInteger(Record.ArgumentList)); |
167 | 667 | error667 (IO.mapInteger(Record.ThisPointerAdjustment)); |
168 | 667 | |
169 | 667 | return Error::success(); |
170 | 667 | } |
171 | | |
172 | 808 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ArgListRecord &Record) { |
173 | 808 | error(IO.mapVectorN<uint32_t>( |
174 | 808 | Record.ArgIndices, |
175 | 808 | [](CodeViewRecordIO &IO, TypeIndex &N) { return IO.mapInteger(N); })); |
176 | 808 | |
177 | 808 | return Error::success(); |
178 | 808 | } |
179 | | |
180 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
181 | 67 | StringListRecord &Record) { |
182 | 67 | error(IO.mapVectorN<uint32_t>( |
183 | 67 | Record.StringIndices, |
184 | 67 | [](CodeViewRecordIO &IO, TypeIndex &N) { return IO.mapInteger(N); })); |
185 | 67 | |
186 | 67 | return Error::success(); |
187 | 67 | } |
188 | | |
189 | 719 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, PointerRecord &Record) { |
190 | 719 | error719 (IO.mapInteger(Record.ReferentType)); |
191 | 719 | error719 (IO.mapInteger(Record.Attrs)); |
192 | 719 | |
193 | 719 | if (Record.isPointerToMember()719 ) { |
194 | 38 | if (!IO.isWriting()) |
195 | 24 | Record.MemberInfo.emplace(); |
196 | 38 | |
197 | 38 | MemberPointerInfo &M = *Record.MemberInfo; |
198 | 38 | error38 (IO.mapInteger(M.ContainingType)); |
199 | 38 | error38 (IO.mapEnum(M.Representation)); |
200 | 38 | } |
201 | 719 | |
202 | 719 | return Error::success(); |
203 | 719 | } |
204 | | |
205 | 153 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ArrayRecord &Record) { |
206 | 153 | error153 (IO.mapInteger(Record.ElementType)); |
207 | 153 | error153 (IO.mapInteger(Record.IndexType)); |
208 | 153 | error153 (IO.mapEncodedInteger(Record.Size)); |
209 | 153 | error153 (IO.mapStringZ(Record.Name)); |
210 | 153 | |
211 | 153 | return Error::success(); |
212 | 153 | } |
213 | | |
214 | 978 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ClassRecord &Record) { |
215 | 978 | assert((CVR.Type == TypeLeafKind::LF_STRUCTURE) || |
216 | 978 | (CVR.Type == TypeLeafKind::LF_CLASS) || |
217 | 978 | (CVR.Type == TypeLeafKind::LF_INTERFACE)); |
218 | 978 | |
219 | 978 | error978 (IO.mapInteger(Record.MemberCount)); |
220 | 978 | error978 (IO.mapEnum(Record.Options)); |
221 | 978 | error978 (IO.mapInteger(Record.FieldList)); |
222 | 978 | error978 (IO.mapInteger(Record.DerivationList)); |
223 | 978 | error978 (IO.mapInteger(Record.VTableShape)); |
224 | 978 | error978 (IO.mapEncodedInteger(Record.Size)); |
225 | 978 | error(mapNameAndUniqueName(IO, Record.Name, Record.UniqueName, |
226 | 978 | Record.hasUniqueName())); |
227 | 978 | |
228 | 978 | return Error::success(); |
229 | 978 | } |
230 | | |
231 | 29 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UnionRecord &Record) { |
232 | 29 | error29 (IO.mapInteger(Record.MemberCount)); |
233 | 29 | error29 (IO.mapEnum(Record.Options)); |
234 | 29 | error29 (IO.mapInteger(Record.FieldList)); |
235 | 29 | error29 (IO.mapEncodedInteger(Record.Size)); |
236 | 29 | error(mapNameAndUniqueName(IO, Record.Name, Record.UniqueName, |
237 | 29 | Record.hasUniqueName())); |
238 | 29 | |
239 | 29 | return Error::success(); |
240 | 29 | } |
241 | | |
242 | 274 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, EnumRecord &Record) { |
243 | 274 | error274 (IO.mapInteger(Record.MemberCount)); |
244 | 274 | error274 (IO.mapEnum(Record.Options)); |
245 | 274 | error274 (IO.mapInteger(Record.UnderlyingType)); |
246 | 274 | error274 (IO.mapInteger(Record.FieldList)); |
247 | 274 | error(mapNameAndUniqueName(IO, Record.Name, Record.UniqueName, |
248 | 274 | Record.hasUniqueName())); |
249 | 274 | |
250 | 274 | return Error::success(); |
251 | 274 | } |
252 | | |
253 | 26 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, BitFieldRecord &Record) { |
254 | 26 | error26 (IO.mapInteger(Record.Type)); |
255 | 26 | error26 (IO.mapInteger(Record.BitSize)); |
256 | 26 | error26 (IO.mapInteger(Record.BitOffset)); |
257 | 26 | |
258 | 26 | return Error::success(); |
259 | 26 | } |
260 | | |
261 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
262 | 42 | VFTableShapeRecord &Record) { |
263 | 42 | uint16_t Size; |
264 | 42 | if (IO.isWriting()42 ) { |
265 | 9 | ArrayRef<VFTableSlotKind> Slots = Record.getSlots(); |
266 | 9 | Size = Slots.size(); |
267 | 9 | error9 (IO.mapInteger(Size)); |
268 | 9 | |
269 | 16 | for (size_t SlotIndex = 0; SlotIndex < Slots.size()16 ; SlotIndex += 27 ) { |
270 | 7 | uint8_t Byte = static_cast<uint8_t>(Slots[SlotIndex]) << 4; |
271 | 7 | if ((SlotIndex + 1) < Slots.size()7 ) { |
272 | 1 | Byte |= static_cast<uint8_t>(Slots[SlotIndex + 1]); |
273 | 1 | } |
274 | 7 | error7 (IO.mapInteger(Byte)); |
275 | 7 | } |
276 | 42 | } else { |
277 | 33 | error33 (IO.mapInteger(Size)); |
278 | 68 | for (uint16_t I = 0; I < Size68 ; I += 235 ) { |
279 | 35 | uint8_t Byte; |
280 | 35 | error35 (IO.mapInteger(Byte)); |
281 | 35 | Record.Slots.push_back(static_cast<VFTableSlotKind>(Byte & 0xF)); |
282 | 35 | if ((I + 1) < Size) |
283 | 10 | Record.Slots.push_back(static_cast<VFTableSlotKind>(Byte >> 4)); |
284 | 35 | } |
285 | 33 | } |
286 | 42 | |
287 | 42 | return Error::success(); |
288 | 42 | } |
289 | | |
290 | 13 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, VFTableRecord &Record) { |
291 | 13 | error13 (IO.mapInteger(Record.CompleteClass)); |
292 | 13 | error13 (IO.mapInteger(Record.OverriddenVFTable)); |
293 | 13 | error13 (IO.mapInteger(Record.VFPtrOffset)); |
294 | 13 | uint32_t NamesLen = 0; |
295 | 13 | if (IO.isWriting()13 ) { |
296 | 2 | for (auto Name : Record.MethodNames) |
297 | 2 | NamesLen += Name.size() + 1; |
298 | 2 | } |
299 | 13 | error13 (IO.mapInteger(NamesLen)); |
300 | 13 | error(IO.mapVectorTail( |
301 | 13 | Record.MethodNames, |
302 | 13 | [](CodeViewRecordIO &IO, StringRef &S) { return IO.mapStringZ(S); })); |
303 | 13 | |
304 | 13 | return Error::success(); |
305 | 13 | } |
306 | | |
307 | 601 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, StringIdRecord &Record) { |
308 | 601 | error601 (IO.mapInteger(Record.Id)); |
309 | 601 | error601 (IO.mapStringZ(Record.String)); |
310 | 601 | |
311 | 601 | return Error::success(); |
312 | 601 | } |
313 | | |
314 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
315 | 300 | UdtSourceLineRecord &Record) { |
316 | 300 | error300 (IO.mapInteger(Record.UDT)); |
317 | 300 | error300 (IO.mapInteger(Record.SourceFile)); |
318 | 300 | error300 (IO.mapInteger(Record.LineNumber)); |
319 | 300 | |
320 | 300 | return Error::success(); |
321 | 300 | } |
322 | | |
323 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
324 | 45 | UdtModSourceLineRecord &Record) { |
325 | 45 | error45 (IO.mapInteger(Record.UDT)); |
326 | 45 | error45 (IO.mapInteger(Record.SourceFile)); |
327 | 45 | error45 (IO.mapInteger(Record.LineNumber)); |
328 | 45 | error45 (IO.mapInteger(Record.Module)); |
329 | 45 | |
330 | 45 | return Error::success(); |
331 | 45 | } |
332 | | |
333 | 518 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, FuncIdRecord &Record) { |
334 | 518 | error518 (IO.mapInteger(Record.ParentScope)); |
335 | 518 | error518 (IO.mapInteger(Record.FunctionType)); |
336 | 518 | error518 (IO.mapStringZ(Record.Name)); |
337 | 518 | |
338 | 518 | return Error::success(); |
339 | 518 | } |
340 | | |
341 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
342 | 100 | MemberFuncIdRecord &Record) { |
343 | 100 | error100 (IO.mapInteger(Record.ClassType)); |
344 | 100 | error100 (IO.mapInteger(Record.FunctionType)); |
345 | 100 | error100 (IO.mapStringZ(Record.Name)); |
346 | 100 | |
347 | 100 | return Error::success(); |
348 | 100 | } |
349 | | |
350 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
351 | 68 | BuildInfoRecord &Record) { |
352 | 68 | error(IO.mapVectorN<uint16_t>( |
353 | 68 | Record.ArgIndices, |
354 | 68 | [](CodeViewRecordIO &IO, TypeIndex &N) { return IO.mapInteger(N); })); |
355 | 68 | |
356 | 68 | return Error::success(); |
357 | 68 | } |
358 | | |
359 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
360 | 185 | MethodOverloadListRecord &Record) { |
361 | 185 | // TODO: Split the list into multiple records if it's longer than 64KB, using |
362 | 185 | // a subrecord of TypeRecordKind::Index to chain the records together. |
363 | 185 | error185 (IO.mapVectorTail(Record.Methods, MapOneMethodRecord(true))); |
364 | 185 | |
365 | 185 | return Error::success(); |
366 | 185 | } |
367 | | |
368 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
369 | 462 | FieldListRecord &Record) { |
370 | 462 | error462 (IO.mapByteVectorTail(Record.Data)); |
371 | 462 | |
372 | 462 | return Error::success(); |
373 | 462 | } |
374 | | |
375 | | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, |
376 | 7 | TypeServer2Record &Record) { |
377 | 7 | error7 (IO.mapGuid(Record.Guid)); |
378 | 7 | error7 (IO.mapInteger(Record.Age)); |
379 | 7 | error7 (IO.mapStringZ(Record.Name)); |
380 | 7 | return Error::success(); |
381 | 7 | } |
382 | | |
383 | 1 | Error TypeRecordMapping::visitKnownRecord(CVType &CVR, LabelRecord &Record) { |
384 | 1 | error1 (IO.mapEnum(Record.Mode)); |
385 | 1 | return Error::success(); |
386 | 1 | } |
387 | | |
388 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
389 | 42 | BaseClassRecord &Record) { |
390 | 42 | error42 (IO.mapInteger(Record.Attrs.Attrs)); |
391 | 42 | error42 (IO.mapInteger(Record.Type)); |
392 | 42 | error42 (IO.mapEncodedInteger(Record.Offset)); |
393 | 42 | |
394 | 42 | return Error::success(); |
395 | 42 | } |
396 | | |
397 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
398 | 12.3k | EnumeratorRecord &Record) { |
399 | 12.3k | error12.3k (IO.mapInteger(Record.Attrs.Attrs)); |
400 | 12.3k | |
401 | 12.3k | // FIXME: Handle full APInt such as __int128. |
402 | 12.3k | error12.3k (IO.mapEncodedInteger(Record.Value)); |
403 | 12.3k | error12.3k (IO.mapStringZ(Record.Name)); |
404 | 12.3k | |
405 | 12.3k | return Error::success(); |
406 | 12.3k | } |
407 | | |
408 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
409 | 671 | DataMemberRecord &Record) { |
410 | 671 | error671 (IO.mapInteger(Record.Attrs.Attrs)); |
411 | 671 | error671 (IO.mapInteger(Record.Type)); |
412 | 671 | error671 (IO.mapEncodedInteger(Record.FieldOffset)); |
413 | 671 | error671 (IO.mapStringZ(Record.Name)); |
414 | 671 | |
415 | 671 | return Error::success(); |
416 | 671 | } |
417 | | |
418 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
419 | 136 | OverloadedMethodRecord &Record) { |
420 | 136 | error136 (IO.mapInteger(Record.NumOverloads)); |
421 | 136 | error136 (IO.mapInteger(Record.MethodList)); |
422 | 136 | error136 (IO.mapStringZ(Record.Name)); |
423 | 136 | |
424 | 136 | return Error::success(); |
425 | 136 | } |
426 | | |
427 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
428 | 162 | OneMethodRecord &Record) { |
429 | 162 | MapOneMethodRecord Mapper(false); |
430 | 162 | return Mapper(IO, Record); |
431 | 162 | } |
432 | | |
433 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
434 | 168 | NestedTypeRecord &Record) { |
435 | 168 | uint16_t Padding = 0; |
436 | 168 | error168 (IO.mapInteger(Padding)); |
437 | 168 | error168 (IO.mapInteger(Record.Type)); |
438 | 168 | error168 (IO.mapStringZ(Record.Name)); |
439 | 168 | |
440 | 168 | return Error::success(); |
441 | 168 | } |
442 | | |
443 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
444 | 14 | StaticDataMemberRecord &Record) { |
445 | 14 | |
446 | 14 | error14 (IO.mapInteger(Record.Attrs.Attrs)); |
447 | 14 | error14 (IO.mapInteger(Record.Type)); |
448 | 14 | error14 (IO.mapStringZ(Record.Name)); |
449 | 14 | |
450 | 14 | return Error::success(); |
451 | 14 | } |
452 | | |
453 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
454 | 26 | VirtualBaseClassRecord &Record) { |
455 | 26 | |
456 | 26 | error26 (IO.mapInteger(Record.Attrs.Attrs)); |
457 | 26 | error26 (IO.mapInteger(Record.BaseType)); |
458 | 26 | error26 (IO.mapInteger(Record.VBPtrType)); |
459 | 26 | error26 (IO.mapEncodedInteger(Record.VBPtrOffset)); |
460 | 26 | error26 (IO.mapEncodedInteger(Record.VTableIndex)); |
461 | 26 | |
462 | 26 | return Error::success(); |
463 | 26 | } |
464 | | |
465 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
466 | 25 | VFPtrRecord &Record) { |
467 | 25 | uint16_t Padding = 0; |
468 | 25 | error25 (IO.mapInteger(Padding)); |
469 | 25 | error25 (IO.mapInteger(Record.Type)); |
470 | 25 | |
471 | 25 | return Error::success(); |
472 | 25 | } |
473 | | |
474 | | Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, |
475 | 6 | ListContinuationRecord &Record) { |
476 | 6 | uint16_t Padding = 0; |
477 | 6 | error6 (IO.mapInteger(Padding)); |
478 | 6 | error6 (IO.mapInteger(Record.ContinuationIndex)); |
479 | 6 | |
480 | 6 | return Error::success(); |
481 | 6 | } |