75namespace CodeViewYAML {
84 virtual void map(yaml::IO &io) = 0;
93 void map(yaml::IO &io)
override;
96 return TypeDeserializer::deserializeAs<T>(
Type,
Record);
110 void map(yaml::IO &io)
override;
123 virtual void map(yaml::IO &io) = 0;
131 void map(yaml::IO &io)
override;
150 return "GUID strings are 38 characters long";
152 return "GUID is not enclosed in {}";
156 if (
A.size() != 5 || Scalar[8] !=
'-' || Scalar[13] !=
'-' ||
157 Scalar[18] !=
'-' || Scalar[23] !=
'-')
158 return "GUID sections are not properly delineated with dashes";
167 if (!to_integer(
A[0],
G.Data1, 16) || !to_integer(
A[1],
G.Data2, 16) ||
168 !to_integer(
A[2],
G.Data3, 16) || !to_integer(
A[3], D41, 16) ||
169 !to_integer(
A[4], D42, 16))
170 return "GUID contains non hex digits";
171 G.Data4 = (D41 << 48) | D42;
172 ::memcpy(&S, &
G,
sizeof(
GUID));
176void ScalarTraits<TypeIndex>::output(
const TypeIndex &S,
void *,
198void ScalarEnumerationTraits<TypeLeafKind>::enumeration(IO &io,
200#define CV_TYPE(name, val) io.enumCase(Value, #name, name);
201#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
205void ScalarEnumerationTraits<PointerToMemberRepresentation>::enumeration(
207 IO.enumCase(
Value,
"Unknown", PointerToMemberRepresentation::Unknown);
208 IO.enumCase(
Value,
"SingleInheritanceData",
209 PointerToMemberRepresentation::SingleInheritanceData);
210 IO.enumCase(
Value,
"MultipleInheritanceData",
211 PointerToMemberRepresentation::MultipleInheritanceData);
212 IO.enumCase(
Value,
"VirtualInheritanceData",
213 PointerToMemberRepresentation::VirtualInheritanceData);
214 IO.enumCase(
Value,
"GeneralData", PointerToMemberRepresentation::GeneralData);
215 IO.enumCase(
Value,
"SingleInheritanceFunction",
216 PointerToMemberRepresentation::SingleInheritanceFunction);
217 IO.enumCase(
Value,
"MultipleInheritanceFunction",
218 PointerToMemberRepresentation::MultipleInheritanceFunction);
219 IO.enumCase(
Value,
"VirtualInheritanceFunction",
220 PointerToMemberRepresentation::VirtualInheritanceFunction);
221 IO.enumCase(
Value,
"GeneralFunction",
222 PointerToMemberRepresentation::GeneralFunction);
225void ScalarEnumerationTraits<VFTableSlotKind>::enumeration(
227 IO.enumCase(Kind,
"Near16", VFTableSlotKind::Near16);
228 IO.enumCase(Kind,
"Far16", VFTableSlotKind::Far16);
229 IO.enumCase(Kind,
"This", VFTableSlotKind::This);
230 IO.enumCase(Kind,
"Outer", VFTableSlotKind::Outer);
231 IO.enumCase(Kind,
"Meta", VFTableSlotKind::Meta);
232 IO.enumCase(Kind,
"Near", VFTableSlotKind::Near);
233 IO.enumCase(Kind,
"Far", VFTableSlotKind::Far);
236void ScalarEnumerationTraits<CallingConvention>::enumeration(
238 IO.enumCase(
Value,
"NearC", CallingConvention::NearC);
239 IO.enumCase(
Value,
"FarC", CallingConvention::FarC);
240 IO.enumCase(
Value,
"NearPascal", CallingConvention::NearPascal);
241 IO.enumCase(
Value,
"FarPascal", CallingConvention::FarPascal);
242 IO.enumCase(
Value,
"NearFast", CallingConvention::NearFast);
243 IO.enumCase(
Value,
"FarFast", CallingConvention::FarFast);
244 IO.enumCase(
Value,
"NearStdCall", CallingConvention::NearStdCall);
245 IO.enumCase(
Value,
"FarStdCall", CallingConvention::FarStdCall);
246 IO.enumCase(
Value,
"NearSysCall", CallingConvention::NearSysCall);
247 IO.enumCase(
Value,
"FarSysCall", CallingConvention::FarSysCall);
248 IO.enumCase(
Value,
"ThisCall", CallingConvention::ThisCall);
249 IO.enumCase(
Value,
"MipsCall", CallingConvention::MipsCall);
250 IO.enumCase(
Value,
"Generic", CallingConvention::Generic);
251 IO.enumCase(
Value,
"AlphaCall", CallingConvention::AlphaCall);
252 IO.enumCase(
Value,
"PpcCall", CallingConvention::PpcCall);
253 IO.enumCase(
Value,
"SHCall", CallingConvention::SHCall);
254 IO.enumCase(
Value,
"ArmCall", CallingConvention::ArmCall);
255 IO.enumCase(
Value,
"AM33Call", CallingConvention::AM33Call);
256 IO.enumCase(
Value,
"TriCall", CallingConvention::TriCall);
257 IO.enumCase(
Value,
"SH5Call", CallingConvention::SH5Call);
258 IO.enumCase(
Value,
"M32RCall", CallingConvention::M32RCall);
259 IO.enumCase(
Value,
"ClrCall", CallingConvention::ClrCall);
260 IO.enumCase(
Value,
"Inline", CallingConvention::Inline);
261 IO.enumCase(
Value,
"NearVector", CallingConvention::NearVector);
262 IO.enumCase(
Value,
"Swift", CallingConvention::Swift);
265void ScalarEnumerationTraits<PointerKind>::enumeration(IO &IO,
267 IO.enumCase(Kind,
"Near16", PointerKind::Near16);
268 IO.enumCase(Kind,
"Far16", PointerKind::Far16);
269 IO.enumCase(Kind,
"Huge16", PointerKind::Huge16);
270 IO.enumCase(Kind,
"BasedOnSegment", PointerKind::BasedOnSegment);
271 IO.enumCase(Kind,
"BasedOnValue", PointerKind::BasedOnValue);
272 IO.enumCase(Kind,
"BasedOnSegmentValue", PointerKind::BasedOnSegmentValue);
273 IO.enumCase(Kind,
"BasedOnAddress", PointerKind::BasedOnAddress);
274 IO.enumCase(Kind,
"BasedOnSegmentAddress",
275 PointerKind::BasedOnSegmentAddress);
276 IO.enumCase(Kind,
"BasedOnType", PointerKind::BasedOnType);
277 IO.enumCase(Kind,
"BasedOnSelf", PointerKind::BasedOnSelf);
278 IO.enumCase(Kind,
"Near32", PointerKind::Near32);
279 IO.enumCase(Kind,
"Far32", PointerKind::Far32);
280 IO.enumCase(Kind,
"Near64", PointerKind::Near64);
283void ScalarEnumerationTraits<PointerMode>::enumeration(IO &IO,
285 IO.enumCase(Mode,
"Pointer", PointerMode::Pointer);
286 IO.enumCase(Mode,
"LValueReference", PointerMode::LValueReference);
287 IO.enumCase(Mode,
"PointerToDataMember", PointerMode::PointerToDataMember);
288 IO.enumCase(Mode,
"PointerToMemberFunction",
289 PointerMode::PointerToMemberFunction);
290 IO.enumCase(Mode,
"RValueReference", PointerMode::RValueReference);
293void ScalarEnumerationTraits<HfaKind>::enumeration(IO &IO,
HfaKind &
Value) {
294 IO.enumCase(
Value,
"None", HfaKind::None);
295 IO.enumCase(
Value,
"Float", HfaKind::Float);
296 IO.enumCase(
Value,
"Double", HfaKind::Double);
297 IO.enumCase(
Value,
"Other", HfaKind::Other);
300void ScalarEnumerationTraits<MemberAccess>::enumeration(IO &IO,
302 IO.enumCase(
Access,
"None", MemberAccess::None);
303 IO.enumCase(
Access,
"Private", MemberAccess::Private);
304 IO.enumCase(
Access,
"Protected", MemberAccess::Protected);
305 IO.enumCase(
Access,
"Public", MemberAccess::Public);
308void ScalarEnumerationTraits<MethodKind>::enumeration(IO &IO,
310 IO.enumCase(Kind,
"Vanilla", MethodKind::Vanilla);
311 IO.enumCase(Kind,
"Virtual", MethodKind::Virtual);
312 IO.enumCase(Kind,
"Static", MethodKind::Static);
313 IO.enumCase(Kind,
"Friend", MethodKind::Friend);
314 IO.enumCase(Kind,
"IntroducingVirtual", MethodKind::IntroducingVirtual);
315 IO.enumCase(Kind,
"PureVirtual", MethodKind::PureVirtual);
316 IO.enumCase(Kind,
"PureIntroducingVirtual",
317 MethodKind::PureIntroducingVirtual);
320void ScalarEnumerationTraits<WindowsRTClassKind>::enumeration(
322 IO.enumCase(
Value,
"None", WindowsRTClassKind::None);
323 IO.enumCase(
Value,
"Ref", WindowsRTClassKind::RefClass);
324 IO.enumCase(
Value,
"Value", WindowsRTClassKind::ValueClass);
325 IO.enumCase(
Value,
"Interface", WindowsRTClassKind::Interface);
328void ScalarEnumerationTraits<LabelType>::enumeration(IO &IO,
LabelType &
Value) {
329 IO.enumCase(
Value,
"Near", LabelType::Near);
330 IO.enumCase(
Value,
"Far", LabelType::Far);
333void ScalarBitSetTraits<PointerOptions>::bitset(IO &IO,
335 IO.bitSetCase(
Options,
"None", PointerOptions::None);
336 IO.bitSetCase(
Options,
"Flat32", PointerOptions::Flat32);
337 IO.bitSetCase(
Options,
"Volatile", PointerOptions::Volatile);
338 IO.bitSetCase(
Options,
"Const", PointerOptions::Const);
339 IO.bitSetCase(
Options,
"Unaligned", PointerOptions::Unaligned);
340 IO.bitSetCase(
Options,
"Restrict", PointerOptions::Restrict);
341 IO.bitSetCase(
Options,
"WinRTSmartPointer",
342 PointerOptions::WinRTSmartPointer);
345void ScalarBitSetTraits<ModifierOptions>::bitset(IO &IO,
347 IO.bitSetCase(
Options,
"None", ModifierOptions::None);
348 IO.bitSetCase(
Options,
"Const", ModifierOptions::Const);
349 IO.bitSetCase(
Options,
"Volatile", ModifierOptions::Volatile);
350 IO.bitSetCase(
Options,
"Unaligned", ModifierOptions::Unaligned);
353void ScalarBitSetTraits<FunctionOptions>::bitset(IO &IO,
355 IO.bitSetCase(
Options,
"None", FunctionOptions::None);
356 IO.bitSetCase(
Options,
"CxxReturnUdt", FunctionOptions::CxxReturnUdt);
357 IO.bitSetCase(
Options,
"Constructor", FunctionOptions::Constructor);
358 IO.bitSetCase(
Options,
"ConstructorWithVirtualBases",
359 FunctionOptions::ConstructorWithVirtualBases);
363 IO.bitSetCase(
Options,
"None", ClassOptions::None);
364 IO.bitSetCase(
Options,
"HasConstructorOrDestructor",
365 ClassOptions::HasConstructorOrDestructor);
366 IO.bitSetCase(
Options,
"HasOverloadedOperator",
367 ClassOptions::HasOverloadedOperator);
368 IO.bitSetCase(
Options,
"Nested", ClassOptions::Nested);
369 IO.bitSetCase(
Options,
"ContainsNestedClass",
370 ClassOptions::ContainsNestedClass);
371 IO.bitSetCase(
Options,
"HasOverloadedAssignmentOperator",
372 ClassOptions::HasOverloadedAssignmentOperator);
373 IO.bitSetCase(
Options,
"HasConversionOperator",
374 ClassOptions::HasConversionOperator);
375 IO.bitSetCase(
Options,
"ForwardReference", ClassOptions::ForwardReference);
376 IO.bitSetCase(
Options,
"Scoped", ClassOptions::Scoped);
377 IO.bitSetCase(
Options,
"HasUniqueName", ClassOptions::HasUniqueName);
378 IO.bitSetCase(
Options,
"Sealed", ClassOptions::Sealed);
379 IO.bitSetCase(
Options,
"Intrinsic", ClassOptions::Intrinsic);
383 IO.bitSetCase(
Options,
"None", MethodOptions::None);
384 IO.bitSetCase(
Options,
"Pseudo", MethodOptions::Pseudo);
385 IO.bitSetCase(
Options,
"NoInherit", MethodOptions::NoInherit);
386 IO.bitSetCase(
Options,
"NoConstruct", MethodOptions::NoConstruct);
387 IO.bitSetCase(
Options,
"CompilerGenerated", MethodOptions::CompilerGenerated);
388 IO.bitSetCase(
Options,
"Sealed", MethodOptions::Sealed);
397namespace CodeViewYAML {
401 IO.mapRequired(
"ModifiedType",
Record.ModifiedType);
402 IO.mapRequired(
"Modifiers",
Record.Modifiers);
406 IO.mapRequired(
"ReturnType",
Record.ReturnType);
407 IO.mapRequired(
"CallConv",
Record.CallConv);
408 IO.mapRequired(
"Options",
Record.Options);
409 IO.mapRequired(
"ParameterCount",
Record.ParameterCount);
410 IO.mapRequired(
"ArgumentList",
Record.ArgumentList);
414 IO.mapRequired(
"ReturnType",
Record.ReturnType);
415 IO.mapRequired(
"ClassType",
Record.ClassType);
416 IO.mapRequired(
"ThisType",
Record.ThisType);
417 IO.mapRequired(
"CallConv",
Record.CallConv);
418 IO.mapRequired(
"Options",
Record.Options);
419 IO.mapRequired(
"ParameterCount",
Record.ParameterCount);
420 IO.mapRequired(
"ArgumentList",
Record.ArgumentList);
421 IO.mapRequired(
"ThisPointerAdjustment",
Record.ThisPointerAdjustment);
425 IO.mapRequired(
"Mode",
Record.Mode);
429 IO.mapRequired(
"ClassType",
Record.ClassType);
430 IO.mapRequired(
"FunctionType",
Record.FunctionType);
431 IO.mapRequired(
"Name",
Record.Name);
435 IO.mapRequired(
"ArgIndices",
Record.ArgIndices);
439 IO.mapRequired(
"StringIndices",
Record.StringIndices);
443 IO.mapRequired(
"ReferentType",
Record.ReferentType);
444 IO.mapRequired(
"Attrs",
Record.Attrs);
445 IO.mapOptional(
"MemberInfo",
Record.MemberInfo);
449 IO.mapRequired(
"ElementType",
Record.ElementType);
450 IO.mapRequired(
"IndexType",
Record.IndexType);
451 IO.mapRequired(
"Size",
Record.Size);
452 IO.mapRequired(
"Name",
Record.Name);
456 IO.mapRequired(
"FieldList", Members);
467 explicit MemberRecordConversionVisitor(std::vector<MemberRecord> &Records)
468 : Records(Records) {}
470#define TYPE_RECORD(EnumName, EnumVal, Name)
471#define MEMBER_RECORD(EnumName, EnumVal, Name) \
472 Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override { \
473 return visitKnownMemberImpl(Record); \
475#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
476#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
477#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
479 template <
typename T>
Error visitKnownMemberImpl(
T &
Record) {
481 auto Impl = std::make_shared<MemberRecordImpl<T>>(K);
487 std::vector<MemberRecord> &
Records;
493 MemberRecordConversionVisitor
V(Members);
495 cantFail(TypeDeserializer::deserializeAs<FieldListRecord>(
Type,
503 CRB.
begin(ContinuationRecordKind::FieldList);
504 for (
const auto &Member : Members) {
505 Member.Member->writeTo(CRB);
512 io.mapRequired(
"Type",
Record.Type);
513 io.mapRequired(
"Attrs",
Record.Attrs.Attrs);
514 io.mapRequired(
"VFTableOffset",
Record.VFTableOffset);
515 io.mapRequired(
"Name",
Record.Name);
519namespace CodeViewYAML {
523 IO.mapRequired(
"MemberCount",
Record.MemberCount);
524 IO.mapRequired(
"Options",
Record.Options);
525 IO.mapRequired(
"FieldList",
Record.FieldList);
526 IO.mapRequired(
"Name",
Record.Name);
527 IO.mapRequired(
"UniqueName",
Record.UniqueName);
528 IO.mapRequired(
"DerivationList",
Record.DerivationList);
529 IO.mapRequired(
"VTableShape",
Record.VTableShape);
530 IO.mapRequired(
"Size",
Record.Size);
534 IO.mapRequired(
"MemberCount",
Record.MemberCount);
535 IO.mapRequired(
"Options",
Record.Options);
536 IO.mapRequired(
"FieldList",
Record.FieldList);
537 IO.mapRequired(
"Name",
Record.Name);
538 IO.mapRequired(
"UniqueName",
Record.UniqueName);
539 IO.mapRequired(
"Size",
Record.Size);
543 IO.mapRequired(
"NumEnumerators",
Record.MemberCount);
544 IO.mapRequired(
"Options",
Record.Options);
545 IO.mapRequired(
"FieldList",
Record.FieldList);
546 IO.mapRequired(
"Name",
Record.Name);
547 IO.mapRequired(
"UniqueName",
Record.UniqueName);
548 IO.mapRequired(
"UnderlyingType",
Record.UnderlyingType);
552 IO.mapRequired(
"Type",
Record.Type);
553 IO.mapRequired(
"BitSize",
Record.BitSize);
554 IO.mapRequired(
"BitOffset",
Record.BitOffset);
558 IO.mapRequired(
"Slots",
Record.Slots);
562 IO.mapRequired(
"Guid",
Record.Guid);
563 IO.mapRequired(
"Age",
Record.Age);
564 IO.mapRequired(
"Name",
Record.Name);
568 IO.mapRequired(
"Id",
Record.Id);
569 IO.mapRequired(
"String",
Record.String);
573 IO.mapRequired(
"ParentScope",
Record.ParentScope);
574 IO.mapRequired(
"FunctionType",
Record.FunctionType);
575 IO.mapRequired(
"Name",
Record.Name);
579 IO.mapRequired(
"UDT",
Record.UDT);
580 IO.mapRequired(
"SourceFile",
Record.SourceFile);
581 IO.mapRequired(
"LineNumber",
Record.LineNumber);
585 IO.mapRequired(
"UDT",
Record.UDT);
586 IO.mapRequired(
"SourceFile",
Record.SourceFile);
587 IO.mapRequired(
"LineNumber",
Record.LineNumber);
588 IO.mapRequired(
"Module",
Record.Module);
592 IO.mapRequired(
"ArgIndices",
Record.ArgIndices);
596 IO.mapRequired(
"CompleteClass",
Record.CompleteClass);
597 IO.mapRequired(
"OverriddenVFTable",
Record.OverriddenVFTable);
598 IO.mapRequired(
"VFPtrOffset",
Record.VFPtrOffset);
599 IO.mapRequired(
"MethodNames",
Record.MethodNames);
603 IO.mapRequired(
"Methods",
Record.Methods);
607 IO.mapRequired(
"StartTypeIndex",
Record.StartTypeIndex);
608 IO.mapRequired(
"TypesCount",
Record.TypesCount);
609 IO.mapRequired(
"Signature",
Record.Signature);
610 IO.mapRequired(
"PrecompFilePath",
Record.PrecompFilePath);
614 IO.mapRequired(
"Signature",
Record.Signature);
622 IO.mapRequired(
"NumOverloads",
Record.NumOverloads);
623 IO.mapRequired(
"MethodList",
Record.MethodList);
624 IO.mapRequired(
"Name",
Record.Name);
628 IO.mapRequired(
"Type",
Record.Type);
629 IO.mapRequired(
"Name",
Record.Name);
633 IO.mapRequired(
"Attrs",
Record.Attrs.Attrs);
634 IO.mapRequired(
"Type",
Record.Type);
635 IO.mapRequired(
"FieldOffset",
Record.FieldOffset);
636 IO.mapRequired(
"Name",
Record.Name);
640 IO.mapRequired(
"Attrs",
Record.Attrs.Attrs);
641 IO.mapRequired(
"Type",
Record.Type);
642 IO.mapRequired(
"Name",
Record.Name);
646 IO.mapRequired(
"Attrs",
Record.Attrs.Attrs);
647 IO.mapRequired(
"Value",
Record.Value);
648 IO.mapRequired(
"Name",
Record.Name);
652 IO.mapRequired(
"Type",
Record.Type);
656 IO.mapRequired(
"Attrs",
Record.Attrs.Attrs);
657 IO.mapRequired(
"Type",
Record.Type);
658 IO.mapRequired(
"Offset",
Record.Offset);
662 IO.mapRequired(
"Attrs",
Record.Attrs.Attrs);
663 IO.mapRequired(
"BaseType",
Record.BaseType);
664 IO.mapRequired(
"VBPtrType",
Record.VBPtrType);
665 IO.mapRequired(
"VBPtrOffset",
Record.VBPtrOffset);
666 IO.mapRequired(
"VTableIndex",
Record.VTableIndex);
670 IO.mapRequired(
"ContinuationIndex",
Record.ContinuationIndex);
681 auto Impl = std::make_shared<LeafRecordImpl<T>>(
Type.kind());
682 if (
auto EC = Impl->fromCodeViewRecord(
Type))
683 return std::move(
EC);
689#define TYPE_RECORD(EnumName, EnumVal, ClassName) \
691 return fromCodeViewRecordImpl<ClassName##Record>(Type);
692#define TYPE_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
693 TYPE_RECORD(EnumName, EnumVal, ClassName)
694#define MEMBER_RECORD(EnumName, EnumVal, ClassName)
695#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
696 switch (
Type.kind()) {
697#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
701 return make_error<CodeViewError>(cv_error_code::corrupt_record);
706 return Leaf->toCodeViewRecord(Serializer);
723template <
typename ConcreteType>
726 if (!IO.outputting())
727 Obj.
Leaf = std::make_shared<LeafRecordImpl<ConcreteType>>(Kind);
729 if (Kind == LF_FIELDLIST)
732 IO.mapRequired(Class, *Obj.
Leaf);
739 IO.mapRequired(
"Kind", Kind);
741#define TYPE_RECORD(EnumName, EnumVal, ClassName) \
743 mapLeafRecordImpl<ClassName##Record>(IO, #ClassName, Kind, Obj); \
745#define TYPE_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
746 TYPE_RECORD(EnumName, EnumVal, ClassName)
747#define MEMBER_RECORD(EnumName, EnumVal, ClassName)
748#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
750#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
755template <
typename ConcreteType>
758 if (!IO.outputting())
759 Obj.
Member = std::make_shared<MemberRecordImpl<ConcreteType>>(Kind);
761 IO.mapRequired(Class, *Obj.
Member);
768 IO.mapRequired(
"Kind", Kind);
770#define MEMBER_RECORD(EnumName, EnumVal, ClassName) \
772 mapMemberRecordImpl<ClassName##Record>(IO, #ClassName, Kind, Obj); \
774#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName) \
775 MEMBER_RECORD(EnumName, EnumVal, ClassName)
776#define TYPE_RECORD(EnumName, EnumVal, ClassName)
777#define TYPE_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
779#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
784std::vector<LeafRecord>
794 "Invalid .debug$T or .debug$P section!");
796 std::vector<LeafRecord> Result;
798 for (
const auto &
T : Types) {
800 Result.push_back(CVT);
810 for (
const auto &Leaf : Leafs) {
811 CVType T = Leaf.Leaf->toCodeViewRecord(TS);
813 assert(
T.length() % 4 == 0 &&
"Improper type record alignment!");
821 for (
const auto &R : TS.
records()) {
This file implements the APSInt class, which is a simple class that represents an arbitrary sized int...
This file defines the BumpPtrAllocator interface.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static void mapLeafRecordImpl(IO &IO, const char *Class, TypeLeafKind Kind, LeafRecord &Obj)
static Expected< LeafRecord > fromCodeViewRecordImpl(CVType Type)
static void mapMemberRecordImpl(IO &IO, const char *Class, TypeLeafKind Kind, MemberRecord &Obj)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
#define LLVM_YAML_DECLARE_BITSET_TRAITS(Type)
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
#define LLVM_YAML_DECLARE_SCALAR_TRAITS(Type, MustQuote)
#define LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(type)
#define LLVM_YAML_DECLARE_MAPPING_TRAITS(Type)
#define LLVM_YAML_DECLARE_ENUM_TRAITS(Type)
void print(raw_ostream &OS, bool isSigned) const
An arbitrary precision integer that knows its signedness.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Provides read only access to a subclass of BinaryStream.
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
uint64_t bytesRemaining() const
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...
Provides write only access to a subclass of WritableBinaryStream.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
uint64_t bytesRemaining() const
Error writeBytes(ArrayRef< uint8_t > Buffer)
Write the bytes specified in Buffer to the underlying stream.
Allocate memory in an ever growing pool, as if by bump-pointer.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Helper for check-and-exit error handling.
Tagged union holding either a T or a Error.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
TypeIndex insertRecord(ContinuationRecordBuilder &Builder)
ArrayRef< ArrayRef< uint8_t > > records() const
TypeIndex writeLeafType(T &Record)
void begin(ContinuationRecordKind RecordKind)
void writeMemberType(RecordType &Record)
PointerToMemberRepresentation Representation
void setIndex(uint32_t I)
uint32_t getIndex() const
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::vector< LeafRecord > fromDebugT(ArrayRef< uint8_t > DebugTorP, StringRef SectionName)
ArrayRef< uint8_t > toDebugT(ArrayRef< LeafRecord >, BumpPtrAllocator &Alloc, StringRef SectionName)
llvm::SmallVector< std::shared_ptr< RecordsSlice >, 4 > Records
CVRecord< TypeLeafKind > CVType
PointerMode
Equivalent to CV_ptrmode_e.
PointerOptions
Equivalent to misc lfPointerAttr bitfields.
MethodKind
Part of member attribute flags. (CV_methodprop_e)
PointerKind
Equivalent to CV_ptrtype_e.
PointerToMemberRepresentation
Equivalent to CV_pmtype_e.
Error visitMemberRecordStream(ArrayRef< uint8_t > FieldList, TypeVisitorCallbacks &Callbacks)
CallingConvention
These values correspond to the CV_call_e enumeration, and are documented at the following locations: ...
MethodOptions
Equivalent to CV_fldattr_t bitfield.
MemberAccess
Source-level access specifier. (CV_access_e)
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
TypeRecordKind
Distinguishes individual records in .debug$T or .debug$P section or PDB type stream.
ModifierOptions
Equivalent to CV_modifier_t.
LabelType
Equivalent to CV_LABEL_TYPE_e.
This is an optimization pass for GlobalISel generic memory operations.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
std::shared_ptr< detail::LeafRecordBase > Leaf
static Expected< LeafRecord > fromCodeViewRecord(codeview::CVType Type)
codeview::CVType toCodeViewRecord(codeview::AppendingTypeTableBuilder &Serializer) const
std::shared_ptr< detail::MemberRecordBase > Member
virtual CVType toCodeViewRecord(AppendingTypeTableBuilder &TS) const =0
virtual void map(yaml::IO &io)=0
LeafRecordBase(TypeLeafKind K)
virtual ~LeafRecordBase()=default
virtual Error fromCodeViewRecord(CVType Type)=0
CVType toCodeViewRecord(AppendingTypeTableBuilder &TS) const override
LeafRecordImpl(TypeLeafKind K)
Error fromCodeViewRecord(CVType Type) override
std::vector< MemberRecord > Members
Error fromCodeViewRecord(CVType Type) override
void map(yaml::IO &io) override
LeafRecordImpl(TypeLeafKind K)
CVType toCodeViewRecord(AppendingTypeTableBuilder &TS) const override
virtual void writeTo(ContinuationRecordBuilder &CRB)=0
virtual ~MemberRecordBase()=default
virtual void map(yaml::IO &io)=0
MemberRecordBase(TypeLeafKind K)
void map(yaml::IO &io) override
void writeTo(ContinuationRecordBuilder &CRB) override
MemberRecordImpl(TypeLeafKind K)
This represents the 'GUID' type from windows.h.
static void mapping(IO &io, LeafRecordBase &Record)
static void mapping(IO &io, MemberRecordBase &Record)