/// Visits the type records in Data. Sets the error flag on parse failures.
Error visitTypeStream(const CVTypeArray &Types);
- Error visitFieldListMemberStream(ArrayRef<uint8_t> FieldList);
-
private:
/// The interface to the class that gets notified of each visitation.
TypeVisitorCallbacks &Callbacks;
namespace llvm {
namespace codeview {
ArrayRef<EnumEntry<SymbolKind>> getSymbolTypeNames();
-ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames();
ArrayRef<EnumEntry<uint16_t>> getRegisterNames();
ArrayRef<EnumEntry<uint8_t>> getProcSymFlagNames();
ArrayRef<EnumEntry<uint16_t>> getLocalFlagNames();
namespace llvm {
namespace codeview {
-class TypeDeserializer : public TypeVisitorCallbacks {
+class TypeDeserializerBase : public TypeVisitorCallbacks {
public:
- explicit TypeDeserializer(TypeVisitorCallbacks &Recipient)
+ explicit TypeDeserializerBase(TypeVisitorCallbacks &Recipient)
: Recipient(Recipient) {}
Error visitTypeBegin(const CVRecord<TypeLeafKind> &Record) override {
return Recipient.visitKnownRecord(CVR, Record);
}
};
+
+class TypeDeserializer : public TypeDeserializerBase {
+public:
+ explicit TypeDeserializer(TypeVisitorCallbacks &Recipient)
+ : TypeDeserializerBase(Recipient) {}
+
+ /// FieldList records need special handling. For starters, they do not
+ /// describe their own length, so a different extraction algorithm is
+ /// necessary. Secondly, a single FieldList record will result in the
+ /// deserialization of many records. So even though the top level visitor
+ /// calls visitFieldBegin() on a single record, multiple records get visited
+ /// through the callback interface.
+ Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
+ FieldListRecord &Record) override;
+
+private:
+ template <typename T>
+ Error visitKnownMember(ArrayRef<uint8_t> &Data, TypeLeafKind Kind,
+ T &Record) {
+ ArrayRef<uint8_t> OldData = Data;
+ if (auto EC = deserializeRecord(Data, Kind, Record))
+ return EC;
+ assert(Data.size() < OldData.size());
+
+ CVRecord<TypeLeafKind> CVR;
+ CVR.Length = OldData.size() - Data.size();
+ CVR.Data = OldData.slice(0, CVR.Length);
+ CVR.RawData = CVR.Data;
+ return Recipient.visitKnownRecord(CVR, Record);
+ }
+
+ Error skipPadding(ArrayRef<uint8_t> &Data);
+};
}
}
ScopedPrinter *W;
- bool IsInFieldList = false;
bool PrintRecordBytes = false;
/// Name of the current type. Only valid before visitTypeEnd.
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/CodeView/CVRecord.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
using llvm::support::ulittle16_t;
using llvm::support::ulittle32_t;
-typedef CVRecord<TypeLeafKind> CVType;
-typedef msf::VarStreamArray<CVType> CVTypeArray;
-
/// Equvalent to CV_fldattr_t in cvinfo.h.
struct MemberAttributes {
ulittle16_t Attrs;
return Representation;
}
- TypeIndex ContainingType;
- PointerToMemberRepresentation Representation;
-
private:
struct Layout {
TypeIndex ClassType;
ulittle16_t Representation; // PointerToMemberRepresentation
};
+
+ TypeIndex ContainingType;
+ PointerToMemberRepresentation Representation;
};
class TypeRecord {
protected:
- TypeRecord() {}
explicit TypeRecord(TypeRecordKind Kind) : Kind(Kind) {}
public:
TypeIndex getModifiedType() const { return ModifiedType; }
ModifierOptions getModifiers() const { return Modifiers; }
- TypeIndex ModifiedType;
- ModifierOptions Modifiers;
-
private:
struct Layout {
TypeIndex ModifiedType;
ulittle16_t Modifiers; // ModifierOptions
};
+
+ TypeIndex ModifiedType;
+ ModifierOptions Modifiers;
};
// LF_PROCEDURE
uint16_t getParameterCount() const { return ParameterCount; }
TypeIndex getArgumentList() const { return ArgumentList; }
- TypeIndex ReturnType;
- CallingConvention CallConv;
- FunctionOptions Options;
- uint16_t ParameterCount;
- TypeIndex ArgumentList;
-
private:
struct Layout {
TypeIndex ReturnType;
ulittle16_t NumParameters;
TypeIndex ArgListType;
};
+
+ TypeIndex ReturnType;
+ CallingConvention CallConv;
+ FunctionOptions Options;
+ uint16_t ParameterCount;
+ TypeIndex ArgumentList;
};
// LF_MFUNCTION
TypeIndex getArgumentList() const { return ArgumentList; }
int32_t getThisPointerAdjustment() const { return ThisPointerAdjustment; }
- TypeIndex ReturnType;
- TypeIndex ClassType;
- TypeIndex ThisType;
- CallingConvention CallConv;
- FunctionOptions Options;
- uint16_t ParameterCount;
- TypeIndex ArgumentList;
- int32_t ThisPointerAdjustment;
-
private:
struct Layout {
TypeIndex ReturnType;
TypeIndex ArgListType;
little32_t ThisAdjustment;
};
+
+ TypeIndex ReturnType;
+ TypeIndex ClassType;
+ TypeIndex ThisType;
+ CallingConvention CallConv;
+ FunctionOptions Options;
+ uint16_t ParameterCount;
+ TypeIndex ArgumentList;
+ int32_t ThisPointerAdjustment;
};
// LF_MFUNC_ID
TypeIndex getClassType() const { return ClassType; }
TypeIndex getFunctionType() const { return FunctionType; }
StringRef getName() const { return Name; }
- TypeIndex ClassType;
- TypeIndex FunctionType;
- StringRef Name;
private:
struct Layout {
TypeIndex FunctionType;
// Name: The null-terminated name follows.
};
+ TypeIndex ClassType;
+ TypeIndex FunctionType;
+ StringRef Name;
};
// LF_ARGLIST, LF_SUBSTR_LIST
static uint32_t getLayoutSize() { return 2 + sizeof(Layout); }
- std::vector<TypeIndex> StringIndices;
-
private:
struct Layout {
ulittle32_t NumArgs; // Number of arguments
// ArgTypes[]: Type indicies of arguments
};
+
+ std::vector<TypeIndex> StringIndices;
};
// LF_POINTER
PointerRecord(TypeIndex ReferentType, PointerKind Kind, PointerMode Mode,
PointerOptions Options, uint8_t Size)
- : TypeRecord(TypeRecordKind::Pointer), ReferentType(ReferentType),
- PtrKind(Kind), Mode(Mode), Options(Options), Size(Size) {}
+ : PointerRecord(ReferentType, Kind, Mode, Options, Size,
+ MemberPointerInfo()) {}
PointerRecord(TypeIndex ReferentType, PointerKind Kind, PointerMode Mode,
PointerOptions Options, uint8_t Size,
PointerMode getMode() const { return Mode; }
PointerOptions getOptions() const { return Options; }
uint8_t getSize() const { return Size; }
- MemberPointerInfo getMemberInfo() const { return *MemberInfo; }
+ MemberPointerInfo getMemberInfo() const { return MemberInfo; }
bool isPointerToMember() const {
return Mode == PointerMode::PointerToDataMember ||
return !!(uint32_t(Options) & uint32_t(PointerOptions::Unaligned));
}
- TypeIndex ReferentType;
- PointerKind PtrKind;
- PointerMode Mode;
- PointerOptions Options;
- uint8_t Size;
- Optional<MemberPointerInfo> MemberInfo;
-
private:
struct Layout {
TypeIndex PointeeType;
return isPointerToMemberFunction() || isPointerToDataMember();
}
};
+
+ TypeIndex ReferentType;
+ PointerKind PtrKind;
+ PointerMode Mode;
+ PointerOptions Options;
+ uint8_t Size;
+ MemberPointerInfo MemberInfo;
};
// LF_NESTTYPE
TypeIndex getNestedType() const { return Type; }
StringRef getName() const { return Name; }
- TypeIndex Type;
- StringRef Name;
-
private:
struct Layout {
ulittle16_t Pad0; // Should be zero
TypeIndex Type; // Type index of nested type
// Name: Null-terminated string
};
+
+ TypeIndex Type;
+ StringRef Name;
};
// LF_FIELDLIST
class FieldListRecord : public TypeRecord {
public:
explicit FieldListRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
- explicit FieldListRecord(ArrayRef<uint8_t> Data)
- : TypeRecord(TypeRecordKind::FieldList), Data(Data) {}
+ FieldListRecord(ArrayRef<uint8_t> ListData)
+ : TypeRecord(TypeRecordKind::FieldList), ListData(ListData) {}
/// Rewrite member type indices with IndexMap. Returns false if a type index
/// is not in the map.
static Expected<FieldListRecord> deserialize(TypeRecordKind Kind,
ArrayRef<uint8_t> &Data);
- ArrayRef<uint8_t> Data;
+ ArrayRef<uint8_t> getFieldListData() const { return ListData; }
+
+private:
+ ArrayRef<uint8_t> ListData;
};
// LF_ARRAY
uint64_t getSize() const { return Size; }
llvm::StringRef getName() const { return Name; }
- TypeIndex ElementType;
- TypeIndex IndexType;
- uint64_t Size;
- llvm::StringRef Name;
-
private:
struct Layout {
TypeIndex ElementType;
// SizeOf: LF_NUMERIC encoded size in bytes. Not element count!
// Name: The null-terminated name follows.
};
+
+ TypeIndex ElementType;
+ TypeIndex IndexType;
+ uint64_t Size;
+ llvm::StringRef Name;
};
class TagRecord : public TypeRecord {
StringRef getName() const { return Name; }
StringRef getUniqueName() const { return UniqueName; }
+private:
uint16_t MemberCount;
ClassOptions Options;
TypeIndex FieldList;
TypeIndex getVTableShape() const { return VTableShape; }
uint64_t getSize() const { return Size; }
- HfaKind Hfa;
- WindowsRTClassKind WinRTKind;
- TypeIndex DerivationList;
- TypeIndex VTableShape;
- uint64_t Size;
-
private:
struct Layout {
ulittle16_t MemberCount; // Number of members in FieldList.
return Properties & uint16_t(ClassOptions::HasUniqueName);
}
};
+
+ HfaKind Hfa;
+ WindowsRTClassKind WinRTKind;
+ TypeIndex DerivationList;
+ TypeIndex VTableShape;
+ uint64_t Size;
};
// LF_UNION
HfaKind getHfa() const { return Hfa; }
uint64_t getSize() const { return Size; }
- HfaKind Hfa;
- uint64_t Size;
-
private:
struct Layout {
ulittle16_t MemberCount; // Number of members in FieldList.
return Properties & uint16_t(ClassOptions::HasUniqueName);
}
};
+
+ HfaKind Hfa;
+ uint64_t Size;
};
// LF_ENUM
ArrayRef<uint8_t> &Data);
TypeIndex getUnderlyingType() const { return UnderlyingType; }
- TypeIndex UnderlyingType;
private:
struct Layout {
}
};
+ TypeIndex UnderlyingType;
};
// LF_BITFIELD
TypeIndex getType() const { return Type; }
uint8_t getBitOffset() const { return BitOffset; }
uint8_t getBitSize() const { return BitSize; }
- TypeIndex Type;
- uint8_t BitSize;
- uint8_t BitOffset;
private:
struct Layout {
uint8_t BitOffset;
};
+ TypeIndex Type;
+ uint8_t BitSize;
+ uint8_t BitOffset;
};
// LF_VTSHAPE
return Slots;
}
uint32_t getEntryCount() const { return getSlots().size(); }
- ArrayRef<VFTableSlotKind> SlotsRef;
- std::vector<VFTableSlotKind> Slots;
private:
struct Layout {
// Descriptors[]: 4-bit virtual method descriptors of type CV_VTS_desc_e.
};
+private:
+ ArrayRef<VFTableSlotKind> SlotsRef;
+ std::vector<VFTableSlotKind> Slots;
};
// LF_TYPESERVER2
uint32_t getAge() const { return Age; }
StringRef getName() const { return Name; }
- StringRef Guid;
- uint32_t Age;
- StringRef Name;
private:
struct Layout {
ulittle32_t Age;
// Name: Name of the PDB as a null-terminated string
};
+
+ StringRef Guid;
+ uint32_t Age;
+ StringRef Name;
};
// LF_STRING_ID
TypeIndex getId() const { return Id; }
StringRef getString() const { return String; }
- TypeIndex Id;
- StringRef String;
private:
struct Layout {
TypeIndex id;
// Name: Name of the PDB as a null-terminated string
};
+
+ TypeIndex Id;
+ StringRef String;
};
// LF_FUNC_ID
TypeIndex getFunctionType() const { return FunctionType; }
StringRef getName() const { return Name; }
- TypeIndex ParentScope;
- TypeIndex FunctionType;
- StringRef Name;
private:
struct Layout {
// Name: The null-terminated name follows.
};
+ TypeIndex ParentScope;
+ TypeIndex FunctionType;
+ StringRef Name;
};
// LF_UDT_SRC_LINE
TypeIndex getUDT() const { return UDT; }
TypeIndex getSourceFile() const { return SourceFile; }
uint32_t getLineNumber() const { return LineNumber; }
- TypeIndex UDT;
- TypeIndex SourceFile;
- uint32_t LineNumber;
private:
struct Layout {
ulittle32_t LineNumber;
};
+ TypeIndex UDT;
+ TypeIndex SourceFile;
+ uint32_t LineNumber;
};
// LF_UDT_MOD_SRC_LINE
TypeIndex getSourceFile() const { return SourceFile; }
uint32_t getLineNumber() const { return LineNumber; }
uint16_t getModule() const { return Module; }
- TypeIndex UDT;
- TypeIndex SourceFile;
- uint32_t LineNumber;
- uint16_t Module;
private:
struct Layout {
ulittle16_t Module; // Module that contributes this UDT definition
};
+ TypeIndex UDT;
+ TypeIndex SourceFile;
+ uint32_t LineNumber;
+ uint16_t Module;
};
// LF_BUILDINFO
ArrayRef<uint8_t> &Data);
ArrayRef<TypeIndex> getArgs() const { return ArgIndices; }
- SmallVector<TypeIndex, 4> ArgIndices;
private:
struct Layout {
ulittle16_t NumArgs; // Number of arguments
// ArgTypes[]: Type indicies of arguments
};
+ SmallVector<TypeIndex, 4> ArgIndices;
};
// LF_VFTABLE
return MethodNamesRef;
return MethodNames;
}
- TypeIndex CompleteClass;
- TypeIndex OverriddenVFTable;
- ulittle32_t VFPtrOffset;
- StringRef Name;
- ArrayRef<StringRef> MethodNamesRef;
- std::vector<StringRef> MethodNames;
private:
struct Layout {
// names.
};
+ TypeIndex CompleteClass;
+ TypeIndex OverriddenVFTable;
+ ulittle32_t VFPtrOffset;
+ StringRef Name;
+ ArrayRef<StringRef> MethodNamesRef;
+ std::vector<StringRef> MethodNames;
};
// LF_ONEMETHOD
class OneMethodRecord : public TypeRecord {
public:
- OneMethodRecord() : TypeRecord(TypeRecordKind::OneMethod) {}
explicit OneMethodRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
OneMethodRecord(TypeIndex Type, MethodKind Kind, MethodOptions Options,
MemberAccess Access, int32_t VFTableOffset, StringRef Name)
return Kind == MethodKind::IntroducingVirtual ||
Kind == MethodKind::PureIntroducingVirtual;
}
- TypeIndex Type;
- MethodKind Kind;
- MethodOptions Options;
- MemberAccess Access;
- int32_t VFTableOffset;
- StringRef Name;
private:
struct Layout {
// Name: Null-terminated string
};
+ TypeIndex Type;
+ MethodKind Kind;
+ MethodOptions Options;
+ MemberAccess Access;
+ int32_t VFTableOffset;
+ StringRef Name;
};
// LF_METHODLIST
deserialize(TypeRecordKind Kind, ArrayRef<uint8_t> &Data);
ArrayRef<OneMethodRecord> getMethods() const { return Methods; }
- std::vector<OneMethodRecord> Methods;
private:
struct Layout {
// VFTableOffset: int32_t offset in vftable
};
+ std::vector<OneMethodRecord> Methods;
};
/// For method overload sets. LF_METHOD
uint16_t getNumOverloads() const { return NumOverloads; }
TypeIndex getMethodList() const { return MethodList; }
StringRef getName() const { return Name; }
- uint16_t NumOverloads;
- TypeIndex MethodList;
- StringRef Name;
private:
struct Layout {
// Name: Null-terminated string
};
+ uint16_t NumOverloads;
+ TypeIndex MethodList;
+ StringRef Name;
};
// LF_MEMBER
TypeIndex getType() const { return Type; }
uint64_t getFieldOffset() const { return FieldOffset; }
StringRef getName() const { return Name; }
- MemberAccess Access;
- TypeIndex Type;
- uint64_t FieldOffset;
- StringRef Name;
private:
struct Layout {
// Name: Null-terminated string
};
+ MemberAccess Access;
+ TypeIndex Type;
+ uint64_t FieldOffset;
+ StringRef Name;
};
// LF_STMEMBER
MemberAccess getAccess() const { return Access; }
TypeIndex getType() const { return Type; }
StringRef getName() const { return Name; }
- MemberAccess Access;
- TypeIndex Type;
- StringRef Name;
private:
struct Layout {
// Name: Null-terminated string
};
+ MemberAccess Access;
+ TypeIndex Type;
+ StringRef Name;
};
// LF_ENUMERATE
MemberAccess getAccess() const { return Access; }
APSInt getValue() const { return Value; }
StringRef getName() const { return Name; }
- MemberAccess Access;
- APSInt Value;
- StringRef Name;
private:
struct Layout {
// Name: Null-terminated string
};
+ MemberAccess Access;
+ APSInt Value;
+ StringRef Name;
};
// LF_VFUNCTAB
ArrayRef<uint8_t> &Data);
TypeIndex getType() const { return Type; }
- TypeIndex Type;
private:
struct Layout {
ulittle16_t Pad0;
TypeIndex Type; // Type of vfptr
};
+ TypeIndex Type;
};
// LF_BCLASS, LF_BINTERFACE
MemberAccess getAccess() const { return Access; }
TypeIndex getBaseType() const { return Type; }
uint64_t getBaseOffset() const { return Offset; }
- MemberAccess Access;
- TypeIndex Type;
- uint64_t Offset;
private:
struct Layout {
TypeIndex BaseType; // Base class type
// BaseOffset: LF_NUMERIC encoded byte offset of base from derived.
};
+ MemberAccess Access;
+ TypeIndex Type;
+ uint64_t Offset;
};
// LF_VBCLASS, LF_IVBCLASS
TypeIndex getVBPtrType() const { return VBPtrType; }
uint64_t getVBPtrOffset() const { return VBPtrOffset; }
uint64_t getVTableIndex() const { return VTableIndex; }
- MemberAccess Access;
- TypeIndex BaseType;
- TypeIndex VBPtrType;
- uint64_t VBPtrOffset;
- uint64_t VTableIndex;
private:
struct Layout {
// VBPtrOffset: Offset of vbptr from vfptr encoded as LF_NUMERIC.
// VBTableIndex: Index of vbase within vbtable encoded as LF_NUMERIC.
};
+ MemberAccess Access;
+ TypeIndex BaseType;
+ TypeIndex VBPtrType;
+ uint64_t VBPtrOffset;
+ uint64_t VTableIndex;
};
/// LF_INDEX - Used to chain two large LF_FIELDLIST or LF_METHODLIST records
static Expected<ListContinuationRecord> deserialize(TypeRecordKind Kind,
ArrayRef<uint8_t> &Data);
- TypeIndex ContinuationIndex;
private:
struct Layout {
ulittle16_t Pad0;
TypeIndex ContinuationIndex;
};
+ TypeIndex ContinuationIndex;
};
+typedef CVRecord<TypeLeafKind> CVType;
+typedef msf::VarStreamArray<CVType> CVTypeArray;
}
}
return Error::success();
}
- bool empty() const { return bytesRemaining() == 0; }
void setOffset(uint32_t Off) { Offset = Off; }
uint32_t getOffset() const { return Offset; }
uint32_t getLength() const { return Stream.getLength(); }
using namespace llvm;
using namespace llvm::codeview;
-template <typename T>
-static Error takeObject(ArrayRef<uint8_t> &Data, const T *&Res) {
- if (Data.size() < sizeof(*Res))
- return llvm::make_error<CodeViewError>(cv_error_code::insufficient_buffer);
- Res = reinterpret_cast<const T *>(Data.data());
- Data = Data.drop_front(sizeof(*Res));
- return Error::success();
-}
-
-template <typename T>
-static Expected<CVType> deserializeMemberRecord(ArrayRef<uint8_t> &Data,
- TypeLeafKind Kind) {
- ArrayRef<uint8_t> OldData = Data;
- TypeRecordKind RK = static_cast<TypeRecordKind>(Kind);
- auto ExpectedRecord = T::deserialize(RK, Data);
- if (!ExpectedRecord)
- return ExpectedRecord.takeError();
- assert(Data.size() < OldData.size());
- if (auto EC = skipPadding(Data))
- return std::move(EC);
-
- CVType CVR;
- CVR.Type = Kind;
- CVR.Length = OldData.size() - Data.size();
- CVR.Data = OldData.slice(0, CVR.Length);
- CVR.RawData = CVR.Data;
- return CVR;
-}
-
-static Error skipPadding(ArrayRef<uint8_t> &Data) {
- if (Data.empty())
- return Error::success();
- uint8_t Leaf = Data.front();
- if (Leaf < LF_PAD0)
- return Error::success();
- // Leaf is greater than 0xf0. We should advance by the number of bytes in
- // the low 4 bits.
- unsigned BytesToAdvance = Leaf & 0x0F;
- if (Data.size() < BytesToAdvance) {
- return llvm::make_error<CodeViewError>(cv_error_code::corrupt_record,
- "Invalid padding bytes!");
- }
- Data = Data.drop_front(BytesToAdvance);
- return Error::success();
-}
-
CVTypeVisitor::CVTypeVisitor(TypeVisitorCallbacks &Callbacks)
: Callbacks(Callbacks) {}
}
#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) \
TYPE_RECORD(EnumVal, EnumVal, AliasName)
-#define MEMBER_RECORD(EnumName, EnumVal, Name) \
- TYPE_RECORD(EnumName, EnumVal, Name)
-#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) \
- MEMBER_RECORD(EnumName, EnumVal, AliasName)
+#define MEMBER_RECORD(EnumName, EnumVal, Name)
#include "llvm/DebugInfo/CodeView/TypeRecords.def"
}
}
return Error::success();
}
-
-Error CVTypeVisitor::visitFieldListMemberStream(ArrayRef<uint8_t> Data) {
- while (!Data.empty()) {
- const support::ulittle16_t *LeafValue;
- if (auto EC = takeObject(Data, LeafValue))
- return std::move(EC);
-
- TypeLeafKind Leaf = static_cast<TypeLeafKind>(uint16_t(*LeafValue));
- CVType Record;
- switch (Leaf) {
- default:
- // Field list records do not describe their own length, so we cannot
- // continue parsing past a type that we don't know how to deserialize.
- return llvm::make_error<CodeViewError>(
- cv_error_code::unknown_member_record);
-#define MEMBER_RECORD(EnumName, EnumVal, Name) \
- case EnumName: { \
- auto ExpectedRecord = deserializeMemberRecord<Name##Record>(Data, Leaf); \
- if (!ExpectedRecord) \
- return ExpectedRecord.takeError(); \
- auto &Record = *ExpectedRecord; \
- if (auto EC = Callbacks.visitTypeBegin(Record)) \
- return EC; \
- if (auto EC = visitKnownRecord<Name##Record>(Record, Callbacks)) \
- return EC; \
- if (auto EC = Callbacks.visitTypeEnd(Record)) \
- return EC; \
- break; \
- }
-#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) \
- MEMBER_RECORD(EnumVal, EnumVal, AliasName)
-#include "llvm/DebugInfo/CodeView/TypeRecords.def"
- }
- }
- return Error::success();
-}
#undef CV_SYMBOL
};
-static const EnumEntry<TypeLeafKind> TypeLeafNames[] = {
-#define CV_TYPE(name, val) {#name, name},
-#include "llvm/DebugInfo/CodeView/TypeRecords.def"
-#undef CV_TYPE
-};
-
static const EnumEntry<uint16_t> RegisterNames[] = {
CV_ENUM_CLASS_ENT(RegisterId, Unknown),
CV_ENUM_CLASS_ENT(RegisterId, VFrame),
return makeArrayRef(SymbolTypeNames);
}
-ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames() {
- return makeArrayRef(TypeLeafNames);
-}
-
ArrayRef<EnumEntry<uint16_t>> getRegisterNames() {
return makeArrayRef(RegisterNames);
}
using namespace llvm;
using namespace llvm::codeview;
+
+template <typename T>
+static Error takeObject(ArrayRef<uint8_t> &Data, const T *&Res) {
+ if (Data.size() < sizeof(*Res))
+ return llvm::make_error<CodeViewError>(cv_error_code::insufficient_buffer);
+ Res = reinterpret_cast<const T *>(Data.data());
+ Data = Data.drop_front(sizeof(*Res));
+ return Error::success();
+}
+
+Error TypeDeserializer::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
+ FieldListRecord &Record) {
+ ArrayRef<uint8_t> FieldListRecordData = CVR.Data;
+ auto ExpectedRecord = FieldListRecord::deserialize(TypeRecordKind::FieldList,
+ FieldListRecordData);
+ if (!ExpectedRecord)
+ return ExpectedRecord.takeError();
+
+ Record = *ExpectedRecord;
+ ArrayRef<uint8_t> MemberData = Record.getFieldListData();
+
+ while (!MemberData.empty()) {
+ const ulittle16_t *LeafPtr;
+ if (auto EC = takeObject(MemberData, LeafPtr))
+ return EC;
+ TypeLeafKind Leaf = TypeLeafKind(unsigned(*LeafPtr));
+ switch (Leaf) {
+ default:
+ // Field list records do not describe their own length, so we cannot
+ // continue parsing past a type that we don't know how to deserialize.
+ if (auto EC = Recipient.visitUnknownMember(CVR))
+ return EC;
+ return llvm::make_error<CodeViewError>(
+ cv_error_code::unknown_member_record);
+#define MEMBER_RECORD(EnumName, EnumVal, Name) \
+ case EnumName: { \
+ TypeRecordKind RK = static_cast<TypeRecordKind>(Leaf); \
+ Name##Record Member(RK); \
+ if (auto EC = visitKnownMember(MemberData, Leaf, Member)) \
+ return EC; \
+ break; \
+ }
+#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) \
+ MEMBER_RECORD(EnumVal, EnumVal, AliasName)
+#include "llvm/DebugInfo/CodeView/TypeRecords.def"
+ }
+ if (auto EC = skipPadding(MemberData))
+ return EC;
+ }
+ return Error::success();
+}
+
+Error TypeDeserializer::skipPadding(ArrayRef<uint8_t> &Data) {
+ if (Data.empty())
+ return Error::success();
+ uint8_t Leaf = Data.front();
+ if (Leaf < LF_PAD0)
+ return Error::success();
+ // Leaf is greater than 0xf0. We should advance by the number of bytes in
+ // the low 4 bits.
+ unsigned BytesToAdvance = Leaf & 0x0F;
+ if (Data.size() < BytesToAdvance) {
+ return llvm::make_error<CodeViewError>(cv_error_code::corrupt_record,
+ "Invalid padding bytes!");
+ }
+ Data = Data.drop_front(BytesToAdvance);
+ return Error::success();
+}
// Reset Name to the empty string. If the visitor sets it, we know it.
Name = "";
- W->startLine() << getLeafTypeName(Record.Type);
- if (!IsInFieldList) {
- // If this is a field list member, don't record its type index because it
- // doesn't have one. Only the outer field list has a type index.
- W->getOStream() << " (" << HexNumber(getNextTypeIndex()) << ")";
- }
- W->getOStream() << " {\n";
+ W->startLine() << getLeafTypeName(Record.Type) << " ("
+ << HexNumber(getNextTypeIndex()) << ") {\n";
W->indent();
W->printEnum("TypeLeafKind", unsigned(Record.Type),
makeArrayRef(LeafTypeNames));
- if (Record.Type == LF_FIELDLIST) {
- // Record that we're in a field list so that members do not get assigned
- // type indices.
- assert(!IsInFieldList);
- IsInFieldList = true;
- }
return Error::success();
}
Error CVTypeDumper::visitTypeEnd(const CVRecord<TypeLeafKind> &Record) {
- if (Record.Type == LF_FIELDLIST) {
- assert(IsInFieldList);
- IsInFieldList = false;
- }
+ if (Record.Type == LF_FIELDLIST)
+ Name = "<field list>";
- if (!IsInFieldList) {
- // Record every type that is not a field list member, even if Name is empty.
- // CVUDTNames is indexed by type index, and must have one entry for every
- // type. Field list members are not recorded, and are only referenced by
- // their containing field list record.
- recordType(Name);
- }
+ // Always record some name for every type, even if Name is empty. CVUDTNames
+ // is indexed by type index, and must have one entry for every type.
+ recordType(Name);
if (PrintRecordBytes)
W->printBinaryBlock("LeafData", getBytesAsCharacters(Record.Data));
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
FieldListRecord &FieldList) {
- TypeDeserializer Deserializer(*this);
- CVTypeVisitor Visitor(Deserializer);
- if (auto EC = Visitor.visitFieldListMemberStream(FieldList.Data))
- return EC;
-
- Name = "<field list>";
return Error::success();
}
}
Error CVTypeDumper::visitUnknownType(const CVRecord<TypeLeafKind> &Record) {
+ DictScope S(*W, "UnknownType");
W->printEnum("Kind", uint16_t(Record.Type), makeArrayRef(LeafTypeNames));
W->printNumber("Length", uint32_t(Record.Data.size()));
return Error::success();
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
NestedTypeRecord &Nested) {
+ DictScope S(*W, "NestedType");
printTypeIndex("Type", Nested.getNestedType());
W->printString("Name", Nested.getName());
Name = Nested.getName();
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
OneMethodRecord &Method) {
+ DictScope S(*W, "OneMethod");
MethodKind K = Method.getKind();
printMemberAttributes(Method.getAccess(), K, Method.getOptions());
printTypeIndex("Type", Method.getType());
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
OverloadedMethodRecord &Method) {
+ DictScope S(*W, "OverloadedMethod");
W->printHex("MethodCount", Method.getNumOverloads());
printTypeIndex("MethodListIndex", Method.getMethodList());
W->printString("Name", Method.getName());
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
DataMemberRecord &Field) {
+ DictScope S(*W, "DataMember");
printMemberAttributes(Field.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
printTypeIndex("Type", Field.getType());
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
StaticDataMemberRecord &Field) {
+ DictScope S(*W, "StaticDataMember");
printMemberAttributes(Field.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
printTypeIndex("Type", Field.getType());
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
VFPtrRecord &VFTable) {
+ DictScope S(*W, "VFPtr");
printTypeIndex("Type", VFTable.getType());
return Error::success();
}
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
EnumeratorRecord &Enum) {
+ DictScope S(*W, "Enumerator");
printMemberAttributes(Enum.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
W->printNumber("EnumValue", Enum.getValue());
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
BaseClassRecord &Base) {
+ DictScope S(*W, "BaseClass");
printMemberAttributes(Base.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
printTypeIndex("BaseType", Base.getBaseType());
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
VirtualBaseClassRecord &Base) {
+ DictScope S(*W, "VirtualBaseClass");
printMemberAttributes(Base.getAccess(), MethodKind::Vanilla,
MethodOptions::None);
printTypeIndex("BaseType", Base.getBaseType());
Error CVTypeDumper::visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
ListContinuationRecord &Cont) {
+ DictScope S(*W, "ListContinuation");
printTypeIndex("ContinuationIndex", Cont.getContinuationIndex());
return Error::success();
}
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
-#include "llvm/DebugInfo/CodeView/RecordSerialization.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
-#include "llvm/DebugInfo/MSF/ByteStream.h"
+#include "llvm/DebugInfo/CodeView/RecordSerialization.h"
using namespace llvm;
using namespace llvm::codeview;
Expected<FieldListRecord>
FieldListRecord::deserialize(TypeRecordKind Kind, ArrayRef<uint8_t> &Data) {
- auto FieldListData = Data;
- Data = ArrayRef<uint8_t>();
- return FieldListRecord(FieldListData);
+ return FieldListRecord(Data);
}
Expected<ArrayRecord> ArrayRecord::deserialize(TypeRecordKind Kind,
bool Success = true;
Success &= remapIndex(IndexMap, ReferentType);
if (isPointerToMember())
- Success &= MemberInfo->remapTypeIndices(IndexMap);
+ Success &= MemberInfo.remapTypeIndices(IndexMap);
return Success;
}
Error visitKnownRecordImpl(FieldListRecord &Record) {
// Don't do anything, this will get written in the call to visitTypeEnd().
- TypeDeserializer Deserializer(*this);
- CVTypeVisitor Visitor(Deserializer);
-
- if (auto EC = Visitor.visitFieldListMemberStream(Record.Data))
- return std::move(EC);
return Error::success();
}
TypeTableBuilder &DestStream;
- bool IsInFieldList{false};
size_t BeginIndexMapSize = 0;
/// Map from source type index to destination type index. Indexed by source
} // end anonymous namespace
Error TypeStreamMerger::visitTypeBegin(const CVRecord<TypeLeafKind> &Rec) {
- if (Rec.Type == TypeLeafKind::LF_FIELDLIST) {
- assert(!IsInFieldList);
- IsInFieldList = true;
- } else
+ if (Rec.Type != TypeLeafKind::LF_FIELDLIST)
BeginIndexMapSize = IndexMap.size();
return Error::success();
}
if (Rec.Type == TypeLeafKind::LF_FIELDLIST) {
IndexMap.push_back(DestStream.writeFieldList(FieldBuilder));
FieldBuilder.reset();
- IsInFieldList = false;
- } else if (!IsInFieldList) {
+ } else {
assert(IndexMap.size() == BeginIndexMapSize + 1);
}
return Error::success();
; CHECK-LABEL: FieldList (0x1000)
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: Enumerator {
-; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: EnumValue: 5460
; CHECK-NEXT: Name: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE5461
; CHECK-LABEL: FieldList (0x1001)
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: Enumerator {
-; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: EnumValue: 4095
; CHECK-NEXT: Name: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE4096
; CHECK-LABEL: FieldList (0x1002)
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: Enumerator {
-; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: EnumValue: 2730
; CHECK-NEXT: Name: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE2731
; CHECK-LABEL: FieldList (0x1003)
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: Enumerator {
-; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: EnumValue: 1365
; CHECK-NEXT: Name: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE1366
; CHECK-LABEL: FieldList (0x1004)
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: Enumerator {
-; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: EnumValue: 0
; CHECK-NEXT: Name: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE1
; CHECK: FieldList (0x1000) {
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: Enumerator {
-; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: EnumValue: 0
; CHECK-NEXT: Name: BLAH
; CHECK: FieldList ({{.*}}) {
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: BaseClass {
-; CHECK-NEXT: TypeLeafKind: LF_BCLASS (0x1400)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: BaseType: B ({{.*}})
; CHECK-NEXT: BaseOffset: 0x8
; CHECK-NEXT: }
; CHECK-NEXT: BaseClass {
-; CHECK-NEXT: TypeLeafKind: LF_BCLASS (0x1400)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: BaseType: C ({{.*}})
; CHECK-NEXT: BaseOffset: 0x18
; CHECK: FieldList ({{.*}}) {
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: VirtualBaseClass {
-; CHECK-NEXT: TypeLeafKind: LF_VBCLASS (0x1401)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: BaseType: A ({{.*}})
; CHECK-NEXT: VBPtrType: const int* ({{.*}})
; CHECK: FieldList ({{.*}}) {
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: VirtualBaseClass {
-; CHECK-NEXT: TypeLeafKind: LF_VBCLASS (0x1401)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: BaseType: A ({{.*}})
; CHECK-NEXT: VBPtrType: const int* ({{.*}})
; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
; CHECK: OneMethod {
-; CHECK-NEXT: TypeLeafKind: LF_ONEMETHOD (0x1511)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: MethodKind: Virtual (0x1)
; CHECK-NEXT: Type: void C::() ({{.*}})
; CHECK-NEXT: Name: f
; CHECK-NEXT: }
; CHECK-NEXT: OneMethod {
-; CHECK-NEXT: TypeLeafKind: LF_ONEMETHOD (0x1511)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: MethodKind: Virtual (0x1)
; CHECK-NEXT: Type: void C::() ({{.*}})
; CHECK-NEXT: }
; CHECK: OneMethod {
-; CHECK-NEXT: TypeLeafKind: LF_ONEMETHOD (0x1511)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: MethodKind: PureVirtual (0x5)
; CHECK-NEXT: Type: void B::() ({{.*}})
; CHECK-NEXT: Name: f
; CHECK-NEXT: }
; CHECK-NEXT: OneMethod {
-; CHECK-NEXT: TypeLeafKind: LF_ONEMETHOD (0x1511)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: MethodKind: Virtual (0x1)
; CHECK-NEXT: Type: void B::() ({{.*}})
; CHECK-NEXT: }
; CHECK: OneMethod {
-; CHECK-NEXT: TypeLeafKind: LF_ONEMETHOD (0x1511)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: MethodKind: IntroducingVirtual (0x4)
; CHECK-NEXT: Type: void A::() ({{.*}})
; CHECK-NEXT: Name: f
; CHECK-NEXT: }
; CHECK-NEXT: OneMethod {
-; CHECK-NEXT: TypeLeafKind: LF_ONEMETHOD (0x1511)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: MethodKind: PureIntroducingVirtual (0x6)
; CHECK-NEXT: Type: void A::() ({{.*}})
; CHECK: FieldList ({{.*}}) {
; CHECK: OneMethod {
-; CHECK-NEXT: TypeLeafKind: LF_ONEMETHOD (0x1511)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: MethodKind: Virtual (0x1)
; CHECK-NEXT: Type: int C::() ([[C_g]])
; CHECK: FieldList ({{.*}}) {
; CHECK: OneMethod {
-; CHECK-NEXT: TypeLeafKind: LF_ONEMETHOD (0x1511)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: MethodKind: Virtual (0x1)
; CHECK-NEXT: Type: int D::() ([[D_g]])
; EMPTY-NEXT: FieldList (0x1002) {
; EMPTY-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; EMPTY-NEXT: Enumerator {
-; EMPTY-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; EMPTY-NEXT: AccessSpecifier: Public (0x3)
; EMPTY-NEXT: EnumValue: 1
; EMPTY-NEXT: Name: apartment
; EMPTY-NEXT: }
; EMPTY-NEXT: Enumerator {
-; EMPTY-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; EMPTY-NEXT: AccessSpecifier: Public (0x3)
; EMPTY-NEXT: EnumValue: 2
; EMPTY-NEXT: Name: single
; EMPTY-NEXT: }
; EMPTY-NEXT: Enumerator {
-; EMPTY-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; EMPTY-NEXT: AccessSpecifier: Public (0x3)
; EMPTY-NEXT: EnumValue: 3
; EMPTY-NEXT: Name: free
; EMPTY-NEXT: }
; EMPTY-NEXT: Enumerator {
-; EMPTY-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; EMPTY-NEXT: AccessSpecifier: Public (0x3)
; EMPTY-NEXT: EnumValue: 4
; EMPTY-NEXT: Name: neutral
; EMPTY-NEXT: }
; EMPTY-NEXT: Enumerator {
-; EMPTY-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; EMPTY-NEXT: AccessSpecifier: Public (0x3)
; EMPTY-NEXT: EnumValue: 5
; EMPTY-NEXT: Name: both
+++ /dev/null
-; RUN: llvm-pdbdump pdb2yaml -tpi-stream %p/Inputs/empty.pdb \\r
-; RUN: | FileCheck -check-prefix=YAML %s\r
-\r
-YAML: ---\r
-YAML: MSF: \r
-YAML: SuperBlock: \r
-YAML: BlockSize: 4096\r
-YAML: FreeBlockMap: 2\r
-YAML: NumBlocks: 25\r
-YAML: NumDirectoryBytes: 136\r
-YAML: Unknown1: 0\r
-YAML: BlockMapAddr: 24\r
-YAML: NumDirectoryBlocks: 1\r
-YAML: DirectoryBlocks: [ 23 ]\r
-YAML: NumStreams: 0\r
-YAML: FileSize: 102400\r
-YAML: TpiStream: \r
-YAML: Version: VC80\r
-YAML: Records: \r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ ]\r
-YAML: - Kind: LF_PROCEDURE\r
-YAML: Procedure: \r
-YAML: ReturnType: 116\r
-YAML: CallConv: NearC\r
-YAML: Options: [ None ]\r
-YAML: ParameterCount: 0\r
-YAML: ArgumentList: 4096\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1\r
-YAML: Name: apartment\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2\r
-YAML: Name: single\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 3\r
-YAML: Name: free\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 4\r
-YAML: Name: neutral\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 5\r
-YAML: Name: both\r
-YAML: - Kind: LF_ENUM\r
-YAML: Enum: \r
-YAML: NumEnumerators: 5\r
-YAML: Options: [ None, Nested, HasUniqueName ]\r
-YAML: FieldList: 4098\r
-YAML: Name: '__vc_attributes::threadingAttribute::threading_e'\r
-YAML: UniqueName: '.?AW4threading_e@threadingAttribute@__vc_attributes@@'\r
-YAML: UnderlyingType: 116\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 0\r
-YAML: Options: [ None, ForwardReference, HasUniqueName ]\r
-YAML: FieldList: 0\r
-YAML: Name: '__vc_attributes::threadingAttribute'\r
-YAML: UniqueName: '.?AUthreadingAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 0\r
-YAML: - Kind: LF_POINTER\r
-YAML: Pointer: \r
-YAML: ReferentType: 4100\r
-YAML: PtrKind: Near32\r
-YAML: Mode: Pointer\r
-YAML: Options: [ None, Const ]\r
-YAML: Size: 4\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 4099 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4100\r
-YAML: ThisType: 4101\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 1\r
-YAML: ArgumentList: 4102\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4100\r
-YAML: ThisType: 4101\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 0\r
-YAML: ArgumentList: 4096\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_METHODLIST\r
-YAML: MethodOverloadList: \r
-YAML: Methods: \r
-YAML: - Type: 4103\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Type: 4104\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_NESTTYPE\r
-YAML: NestedType: \r
-YAML: Type: 4099\r
-YAML: Name: threading_e\r
-YAML: Kind: LF_METHOD\r
-YAML: OverloadedMethod: \r
-YAML: NumOverloads: 2\r
-YAML: MethodList: 4105\r
-YAML: Name: threadingAttribute\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4099\r
-YAML: FieldOffset: 0\r
-YAML: Name: value\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 4\r
-YAML: Options: [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]\r
-YAML: FieldList: 4106\r
-YAML: Name: '__vc_attributes::threadingAttribute'\r
-YAML: UniqueName: '.?AUthreadingAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 4\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 0\r
-YAML: Name: native\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1\r
-YAML: Name: com\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2\r
-YAML: Name: managed\r
-YAML: - Kind: LF_ENUM\r
-YAML: Enum: \r
-YAML: NumEnumerators: 3\r
-YAML: Options: [ None, Nested, HasUniqueName ]\r
-YAML: FieldList: 4108\r
-YAML: Name: '__vc_attributes::event_receiverAttribute::type_e'\r
-YAML: UniqueName: '.?AW4type_e@event_receiverAttribute@__vc_attributes@@'\r
-YAML: UnderlyingType: 116\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 0\r
-YAML: Options: [ None, ForwardReference, HasUniqueName ]\r
-YAML: FieldList: 0\r
-YAML: Name: '__vc_attributes::event_receiverAttribute'\r
-YAML: UniqueName: '.?AUevent_receiverAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 0\r
-YAML: - Kind: LF_POINTER\r
-YAML: Pointer: \r
-YAML: ReferentType: 4110\r
-YAML: PtrKind: Near32\r
-YAML: Mode: Pointer\r
-YAML: Options: [ None, Const ]\r
-YAML: Size: 4\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 4109, 48 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4110\r
-YAML: ThisType: 4111\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 2\r
-YAML: ArgumentList: 4112\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 4109 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4110\r
-YAML: ThisType: 4111\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 1\r
-YAML: ArgumentList: 4114\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4110\r
-YAML: ThisType: 4111\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 0\r
-YAML: ArgumentList: 4096\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_METHODLIST\r
-YAML: MethodOverloadList: \r
-YAML: Methods: \r
-YAML: - Type: 4113\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Type: 4115\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Type: 4116\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_NESTTYPE\r
-YAML: NestedType: \r
-YAML: Type: 4109\r
-YAML: Name: type_e\r
-YAML: Kind: LF_METHOD\r
-YAML: OverloadedMethod: \r
-YAML: NumOverloads: 3\r
-YAML: MethodList: 4117\r
-YAML: Name: event_receiverAttribute\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4109\r
-YAML: FieldOffset: 0\r
-YAML: Name: type\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 48\r
-YAML: FieldOffset: 4\r
-YAML: Name: layout_dependent\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 6\r
-YAML: Options: [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]\r
-YAML: FieldList: 4118\r
-YAML: Name: '__vc_attributes::event_receiverAttribute'\r
-YAML: UniqueName: '.?AUevent_receiverAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 8\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 0\r
-YAML: Name: never\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1\r
-YAML: Name: allowed\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2\r
-YAML: Name: always\r
-YAML: - Kind: LF_ENUM\r
-YAML: Enum: \r
-YAML: NumEnumerators: 3\r
-YAML: Options: [ None, Nested, HasUniqueName ]\r
-YAML: FieldList: 4120\r
-YAML: Name: '__vc_attributes::aggregatableAttribute::type_e'\r
-YAML: UniqueName: '.?AW4type_e@aggregatableAttribute@__vc_attributes@@'\r
-YAML: UnderlyingType: 116\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 0\r
-YAML: Options: [ None, ForwardReference, HasUniqueName ]\r
-YAML: FieldList: 0\r
-YAML: Name: '__vc_attributes::aggregatableAttribute'\r
-YAML: UniqueName: '.?AUaggregatableAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 0\r
-YAML: - Kind: LF_POINTER\r
-YAML: Pointer: \r
-YAML: ReferentType: 4122\r
-YAML: PtrKind: Near32\r
-YAML: Mode: Pointer\r
-YAML: Options: [ None, Const ]\r
-YAML: Size: 4\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 4121 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4122\r
-YAML: ThisType: 4123\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 1\r
-YAML: ArgumentList: 4124\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4122\r
-YAML: ThisType: 4123\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 0\r
-YAML: ArgumentList: 4096\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_METHODLIST\r
-YAML: MethodOverloadList: \r
-YAML: Methods: \r
-YAML: - Type: 4125\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Type: 4126\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_NESTTYPE\r
-YAML: NestedType: \r
-YAML: Type: 4121\r
-YAML: Name: type_e\r
-YAML: Kind: LF_METHOD\r
-YAML: OverloadedMethod: \r
-YAML: NumOverloads: 2\r
-YAML: MethodList: 4127\r
-YAML: Name: aggregatableAttribute\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4121\r
-YAML: FieldOffset: 0\r
-YAML: Name: type\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 4\r
-YAML: Options: [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]\r
-YAML: FieldList: 4128\r
-YAML: Name: '__vc_attributes::aggregatableAttribute'\r
-YAML: UniqueName: '.?AUaggregatableAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 4\r
-YAML: - Kind: LF_ENUM\r
-YAML: Enum: \r
-YAML: NumEnumerators: 3\r
-YAML: Options: [ None, Nested, HasUniqueName ]\r
-YAML: FieldList: 4108\r
-YAML: Name: '__vc_attributes::event_sourceAttribute::type_e'\r
-YAML: UniqueName: '.?AW4type_e@event_sourceAttribute@__vc_attributes@@'\r
-YAML: UnderlyingType: 116\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 0\r
-YAML: Name: speed\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1\r
-YAML: Name: size\r
-YAML: - Kind: LF_ENUM\r
-YAML: Enum: \r
-YAML: NumEnumerators: 2\r
-YAML: Options: [ None, Nested, HasUniqueName ]\r
-YAML: FieldList: 4131\r
-YAML: Name: '__vc_attributes::event_sourceAttribute::optimize_e'\r
-YAML: UniqueName: '.?AW4optimize_e@event_sourceAttribute@__vc_attributes@@'\r
-YAML: UnderlyingType: 116\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 0\r
-YAML: Options: [ None, ForwardReference, HasUniqueName ]\r
-YAML: FieldList: 0\r
-YAML: Name: '__vc_attributes::event_sourceAttribute'\r
-YAML: UniqueName: '.?AUevent_sourceAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 0\r
-YAML: - Kind: LF_POINTER\r
-YAML: Pointer: \r
-YAML: ReferentType: 4133\r
-YAML: PtrKind: Near32\r
-YAML: Mode: Pointer\r
-YAML: Options: [ None, Const ]\r
-YAML: Size: 4\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 4130 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4133\r
-YAML: ThisType: 4134\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 1\r
-YAML: ArgumentList: 4135\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4133\r
-YAML: ThisType: 4134\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 0\r
-YAML: ArgumentList: 4096\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_METHODLIST\r
-YAML: MethodOverloadList: \r
-YAML: Methods: \r
-YAML: - Type: 4136\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Type: 4137\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_NESTTYPE\r
-YAML: NestedType: \r
-YAML: Type: 4130\r
-YAML: Name: type_e\r
-YAML: Kind: LF_NESTTYPE\r
-YAML: NestedType: \r
-YAML: Type: 4132\r
-YAML: Name: optimize_e\r
-YAML: Kind: LF_METHOD\r
-YAML: OverloadedMethod: \r
-YAML: NumOverloads: 2\r
-YAML: MethodList: 4138\r
-YAML: Name: event_sourceAttribute\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4130\r
-YAML: FieldOffset: 0\r
-YAML: Name: type\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4132\r
-YAML: FieldOffset: 4\r
-YAML: Name: optimize\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 48\r
-YAML: FieldOffset: 8\r
-YAML: Name: decorate\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 7\r
-YAML: Options: [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]\r
-YAML: FieldList: 4139\r
-YAML: Name: '__vc_attributes::event_sourceAttribute'\r
-YAML: UniqueName: '.?AUevent_sourceAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 12\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1\r
-YAML: Name: dll\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2\r
-YAML: Name: exe\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 3\r
-YAML: Name: service\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 4\r
-YAML: Name: unspecified\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2\r
-YAML: Name: EXE\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 3\r
-YAML: Name: SERVICE\r
-YAML: - Kind: LF_ENUM\r
-YAML: Enum: \r
-YAML: NumEnumerators: 6\r
-YAML: Options: [ None, Nested, HasUniqueName ]\r
-YAML: FieldList: 4141\r
-YAML: Name: '__vc_attributes::moduleAttribute::type_e'\r
-YAML: UniqueName: '.?AW4type_e@moduleAttribute@__vc_attributes@@'\r
-YAML: UnderlyingType: 116\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 0\r
-YAML: Options: [ None, ForwardReference, HasUniqueName ]\r
-YAML: FieldList: 0\r
-YAML: Name: '__vc_attributes::moduleAttribute'\r
-YAML: UniqueName: '.?AUmoduleAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 0\r
-YAML: - Kind: LF_POINTER\r
-YAML: Pointer: \r
-YAML: ReferentType: 4143\r
-YAML: PtrKind: Near32\r
-YAML: Mode: Pointer\r
-YAML: Options: [ None, Const ]\r
-YAML: Size: 4\r
-YAML: - Kind: LF_MODIFIER\r
-YAML: Modifier: \r
-YAML: ModifiedType: 112\r
-YAML: Modifiers: [ None, Const ]\r
-YAML: - Kind: LF_POINTER\r
-YAML: Pointer: \r
-YAML: ReferentType: 4145\r
-YAML: PtrKind: Near32\r
-YAML: Mode: Pointer\r
-YAML: Options: [ None ]\r
-YAML: Size: 4\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 4142, 4146, 4146, 4146, 116, 48, 4146, 116, \r
-YAML: 4146, 4146, 116, 48, 48, 4146, 4146 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4143\r
-YAML: ThisType: 4144\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 15\r
-YAML: ArgumentList: 4147\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 4142 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4143\r
-YAML: ThisType: 4144\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 1\r
-YAML: ArgumentList: 4149\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4143\r
-YAML: ThisType: 4144\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 0\r
-YAML: ArgumentList: 4096\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_METHODLIST\r
-YAML: MethodOverloadList: \r
-YAML: Methods: \r
-YAML: - Type: 4148\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Type: 4150\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Type: 4151\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: ''\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_NESTTYPE\r
-YAML: NestedType: \r
-YAML: Type: 4142\r
-YAML: Name: type_e\r
-YAML: Kind: LF_METHOD\r
-YAML: OverloadedMethod: \r
-YAML: NumOverloads: 3\r
-YAML: MethodList: 4152\r
-YAML: Name: moduleAttribute\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4142\r
-YAML: FieldOffset: 0\r
-YAML: Name: type\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4146\r
-YAML: FieldOffset: 4\r
-YAML: Name: name\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4146\r
-YAML: FieldOffset: 8\r
-YAML: Name: version\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4146\r
-YAML: FieldOffset: 12\r
-YAML: Name: uuid\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 116\r
-YAML: FieldOffset: 16\r
-YAML: Name: lcid\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 48\r
-YAML: FieldOffset: 20\r
-YAML: Name: control\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4146\r
-YAML: FieldOffset: 24\r
-YAML: Name: helpstring\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 116\r
-YAML: FieldOffset: 28\r
-YAML: Name: helpstringcontext\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4146\r
-YAML: FieldOffset: 32\r
-YAML: Name: helpstringdll\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4146\r
-YAML: FieldOffset: 36\r
-YAML: Name: helpfile\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 116\r
-YAML: FieldOffset: 40\r
-YAML: Name: helpcontext\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 48\r
-YAML: FieldOffset: 44\r
-YAML: Name: hidden\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 48\r
-YAML: FieldOffset: 45\r
-YAML: Name: restricted\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4146\r
-YAML: FieldOffset: 48\r
-YAML: Name: custom\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4146\r
-YAML: FieldOffset: 52\r
-YAML: Name: resource_name\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 19\r
-YAML: Options: [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]\r
-YAML: FieldList: 4153\r
-YAML: Name: '__vc_attributes::moduleAttribute'\r
-YAML: UniqueName: '.?AUmoduleAttribute@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 56\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 0\r
-YAML: Name: eAnyUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1\r
-YAML: Name: eCoClassUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2\r
-YAML: Name: eCOMInterfaceUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 6\r
-YAML: Name: eInterfaceUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 8\r
-YAML: Name: eMemberUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 16\r
-YAML: Name: eMethodUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 32\r
-YAML: Name: eInterfaceMethodUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 64\r
-YAML: Name: eInterfaceMemberUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 128\r
-YAML: Name: eCoClassMemberUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 256\r
-YAML: Name: eCoClassMethodUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 768\r
-YAML: Name: eGlobalMethodUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1024\r
-YAML: Name: eGlobalDataUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2048\r
-YAML: Name: eClassUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 4096\r
-YAML: Name: eInterfaceParameterUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 12288\r
-YAML: Name: eMethodParameterUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 16384\r
-YAML: Name: eIDLModuleUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: -32768\r
-YAML: Name: eAnonymousUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 65536\r
-YAML: Name: eTypedefUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 131072\r
-YAML: Name: eUnionUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 262144\r
-YAML: Name: eEnumUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 524288\r
-YAML: Name: eDefineTagUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1048576\r
-YAML: Name: eStructUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2097152\r
-YAML: Name: eLocalUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 4194304\r
-YAML: Name: ePropertyUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 8388608\r
-YAML: Name: eEventUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 16777216\r
-YAML: Name: eTemplateUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 16777216\r
-YAML: Name: eModuleUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 33554432\r
-YAML: Name: eIllegalUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 67108864\r
-YAML: Name: eAsynchronousUsage\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 4161535\r
-YAML: Name: eAnyIDLUsage\r
-YAML: - Kind: LF_ENUM\r
-YAML: Enum: \r
-YAML: NumEnumerators: 30\r
-YAML: Options: [ None, Nested, HasUniqueName ]\r
-YAML: FieldList: 4155\r
-YAML: Name: '__vc_attributes::helper_attributes::usageAttribute::usage_e'\r
-YAML: UniqueName: '.?AW4usage_e@usageAttribute@helper_attributes@__vc_attributes@@'\r
-YAML: UnderlyingType: 116\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 0\r
-YAML: Options: [ None, ForwardReference, HasUniqueName ]\r
-YAML: FieldList: 0\r
-YAML: Name: '__vc_attributes::helper_attributes::usageAttribute'\r
-YAML: UniqueName: '.?AUusageAttribute@helper_attributes@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 0\r
-YAML: - Kind: LF_POINTER\r
-YAML: Pointer: \r
-YAML: ReferentType: 4157\r
-YAML: PtrKind: Near32\r
-YAML: Mode: Pointer\r
-YAML: Options: [ None, Const ]\r
-YAML: Size: 4\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 117 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4157\r
-YAML: ThisType: 4158\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 1\r
-YAML: ArgumentList: 4159\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_NESTTYPE\r
-YAML: NestedType: \r
-YAML: Type: 4156\r
-YAML: Name: usage_e\r
-YAML: Kind: LF_ONEMETHOD\r
-YAML: OneMethod: \r
-YAML: Type: 4160\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: usageAttribute\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 117\r
-YAML: FieldOffset: 0\r
-YAML: Name: value\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 3\r
-YAML: Options: [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]\r
-YAML: FieldList: 4161\r
-YAML: Name: '__vc_attributes::helper_attributes::usageAttribute'\r
-YAML: UniqueName: '.?AUusageAttribute@helper_attributes@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 4\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 0\r
-YAML: Name: eBoolean\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 1\r
-YAML: Name: eInteger\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 2\r
-YAML: Name: eFloat\r
-YAML: Kind: LF_ENUMERATE\r
-YAML: Enumerator: \r
-YAML: Access: Public\r
-YAML: Value: 3\r
-YAML: Name: eDouble\r
-YAML: - Kind: LF_ENUM\r
-YAML: Enum: \r
-YAML: NumEnumerators: 4\r
-YAML: Options: [ None, Nested, HasUniqueName ]\r
-YAML: FieldList: 4163\r
-YAML: Name: '__vc_attributes::helper_attributes::v1_alttypeAttribute::type_e'\r
-YAML: UniqueName: '.?AW4type_e@v1_alttypeAttribute@helper_attributes@__vc_attributes@@'\r
-YAML: UnderlyingType: 116\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 0\r
-YAML: Options: [ None, ForwardReference, HasUniqueName ]\r
-YAML: FieldList: 0\r
-YAML: Name: '__vc_attributes::helper_attributes::v1_alttypeAttribute'\r
-YAML: UniqueName: '.?AUv1_alttypeAttribute@helper_attributes@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 0\r
-YAML: - Kind: LF_POINTER\r
-YAML: Pointer: \r
-YAML: ReferentType: 4165\r
-YAML: PtrKind: Near32\r
-YAML: Mode: Pointer\r
-YAML: Options: [ None, Const ]\r
-YAML: Size: 4\r
-YAML: - Kind: LF_ARGLIST\r
-YAML: ArgList: \r
-YAML: ArgIndices: [ 4164 ]\r
-YAML: - Kind: LF_MFUNCTION\r
-YAML: MemberFunction: \r
-YAML: ReturnType: 3\r
-YAML: ClassType: 4165\r
-YAML: ThisType: 4166\r
-YAML: CallConv: ThisCall\r
-YAML: Options: [ None, Constructor ]\r
-YAML: ParameterCount: 1\r
-YAML: ArgumentList: 4167\r
-YAML: ThisPointerAdjustment: 0\r
-YAML: - Kind: LF_FIELDLIST\r
-YAML: FieldList: \r
-YAML: Kind: LF_NESTTYPE\r
-YAML: NestedType: \r
-YAML: Type: 4164\r
-YAML: Name: type_e\r
-YAML: Kind: LF_ONEMETHOD\r
-YAML: OneMethod: \r
-YAML: Type: 4168\r
-YAML: Kind: Vanilla\r
-YAML: Options: [ None ]\r
-YAML: Access: Public\r
-YAML: VFTableOffset: -1\r
-YAML: Name: v1_alttypeAttribute\r
-YAML: Kind: LF_MEMBER\r
-YAML: DataMember: \r
-YAML: Access: Public\r
-YAML: Type: 4164\r
-YAML: FieldOffset: 0\r
-YAML: Name: type\r
-YAML: - Kind: LF_STRUCTURE\r
-YAML: Class: \r
-YAML: MemberCount: 3\r
-YAML: Options: [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]\r
-YAML: FieldList: 4169\r
-YAML: Name: '__vc_attributes::helper_attributes::v1_alttypeAttribute'\r
-YAML: UniqueName: '.?AUv1_alttypeAttribute@helper_attributes@__vc_attributes@@'\r
-YAML: Hfa: None\r
-YAML: WinRTKind: None\r
-YAML: DerivationList: 0\r
-YAML: VTableShape: 0\r
-YAML: Size: 4\r
-YAML: ...\r
llvm-pdbdump.cpp
BuiltinDumper.cpp
ClassDefinitionDumper.cpp
- CodeViewYaml.cpp
CompilandDumper.cpp
EnumDumper.cpp
ExternalSymbolDumper.cpp
+++ /dev/null
-//===- PdbYAML.cpp -------------------------------------------- *- C++ --*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "CodeViewYaml.h"
-
-#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
-#include "llvm/DebugInfo/CodeView/EnumTables.h"
-#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
-#include "llvm/DebugInfo/CodeView/TypeRecord.h"
-
-using namespace llvm;
-using namespace llvm::codeview;
-using namespace llvm::codeview::yaml;
-
-LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(TypeIndex)
-LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint64_t)
-LLVM_YAML_IS_SEQUENCE_VECTOR(OneMethodRecord)
-LLVM_YAML_IS_SEQUENCE_VECTOR(VFTableSlotKind)
-LLVM_YAML_IS_SEQUENCE_VECTOR(StringRef)
-LLVM_YAML_IS_SEQUENCE_VECTOR(CVType)
-
-namespace llvm {
-namespace yaml {
-template <> struct ScalarEnumerationTraits<PointerToMemberRepresentation> {
- static void enumeration(IO &IO, PointerToMemberRepresentation &Value) {
- IO.enumCase(Value, "Unknown", PointerToMemberRepresentation::Unknown);
- IO.enumCase(Value, "SingleInheritanceData",
- PointerToMemberRepresentation::SingleInheritanceData);
- IO.enumCase(Value, "MultipleInheritanceData",
- PointerToMemberRepresentation::MultipleInheritanceData);
- IO.enumCase(Value, "VirtualInheritanceData",
- PointerToMemberRepresentation::VirtualInheritanceData);
- IO.enumCase(Value, "GeneralData",
- PointerToMemberRepresentation::GeneralData);
- IO.enumCase(Value, "SingleInheritanceFunction",
- PointerToMemberRepresentation::SingleInheritanceFunction);
- IO.enumCase(Value, "MultipleInheritanceFunction",
- PointerToMemberRepresentation::MultipleInheritanceFunction);
- IO.enumCase(Value, "VirtualInheritanceFunction",
- PointerToMemberRepresentation::VirtualInheritanceFunction);
- IO.enumCase(Value, "GeneralFunction",
- PointerToMemberRepresentation::GeneralFunction);
- }
-};
-
-template <> struct ScalarEnumerationTraits<VFTableSlotKind> {
- static void enumeration(IO &IO, VFTableSlotKind &Kind) {
- IO.enumCase(Kind, "Near16", VFTableSlotKind::Near16);
- IO.enumCase(Kind, "Far16", VFTableSlotKind::Far16);
- IO.enumCase(Kind, "This", VFTableSlotKind::This);
- IO.enumCase(Kind, "Outer", VFTableSlotKind::Outer);
- IO.enumCase(Kind, "Meta", VFTableSlotKind::Meta);
- IO.enumCase(Kind, "Near", VFTableSlotKind::Near);
- IO.enumCase(Kind, "Far", VFTableSlotKind::Far);
- }
-};
-
-template <> struct ScalarEnumerationTraits<CallingConvention> {
- static void enumeration(IO &IO, CallingConvention &Value) {
- IO.enumCase(Value, "NearC", CallingConvention::NearC);
- IO.enumCase(Value, "FarC", CallingConvention::FarC);
- IO.enumCase(Value, "NearPascal", CallingConvention::NearPascal);
- IO.enumCase(Value, "FarPascal", CallingConvention::FarPascal);
- IO.enumCase(Value, "NearFast", CallingConvention::NearFast);
- IO.enumCase(Value, "FarFast", CallingConvention::FarFast);
- IO.enumCase(Value, "NearStdCall", CallingConvention::NearStdCall);
- IO.enumCase(Value, "FarStdCall", CallingConvention::FarStdCall);
- IO.enumCase(Value, "NearSysCall", CallingConvention::NearSysCall);
- IO.enumCase(Value, "FarSysCall", CallingConvention::FarSysCall);
- IO.enumCase(Value, "ThisCall", CallingConvention::ThisCall);
- IO.enumCase(Value, "MipsCall", CallingConvention::MipsCall);
- IO.enumCase(Value, "Generic", CallingConvention::Generic);
- IO.enumCase(Value, "AlphaCall", CallingConvention::AlphaCall);
- IO.enumCase(Value, "PpcCall", CallingConvention::PpcCall);
- IO.enumCase(Value, "SHCall", CallingConvention::SHCall);
- IO.enumCase(Value, "ArmCall", CallingConvention::ArmCall);
- IO.enumCase(Value, "AM33Call", CallingConvention::AM33Call);
- IO.enumCase(Value, "TriCall", CallingConvention::TriCall);
- IO.enumCase(Value, "SH5Call", CallingConvention::SH5Call);
- IO.enumCase(Value, "M32RCall", CallingConvention::M32RCall);
- IO.enumCase(Value, "ClrCall", CallingConvention::ClrCall);
- IO.enumCase(Value, "Inline", CallingConvention::Inline);
- IO.enumCase(Value, "NearVector", CallingConvention::NearVector);
- }
-};
-
-template <> struct ScalarEnumerationTraits<PointerKind> {
- static void enumeration(IO &IO, PointerKind &Kind) {
- IO.enumCase(Kind, "Near16", PointerKind::Near16);
- IO.enumCase(Kind, "Far16", PointerKind::Far16);
- IO.enumCase(Kind, "Huge16", PointerKind::Huge16);
- IO.enumCase(Kind, "BasedOnSegment", PointerKind::BasedOnSegment);
- IO.enumCase(Kind, "BasedOnValue", PointerKind::BasedOnValue);
- IO.enumCase(Kind, "BasedOnSegmentValue", PointerKind::BasedOnSegmentValue);
- IO.enumCase(Kind, "BasedOnAddress", PointerKind::BasedOnAddress);
- IO.enumCase(Kind, "BasedOnSegmentAddress",
- PointerKind::BasedOnSegmentAddress);
- IO.enumCase(Kind, "BasedOnType", PointerKind::BasedOnType);
- IO.enumCase(Kind, "BasedOnSelf", PointerKind::BasedOnSelf);
- IO.enumCase(Kind, "Near32", PointerKind::Near32);
- IO.enumCase(Kind, "Far32", PointerKind::Far32);
- IO.enumCase(Kind, "Near64", PointerKind::Near64);
- }
-};
-
-template <> struct ScalarEnumerationTraits<PointerMode> {
- static void enumeration(IO &IO, PointerMode &Mode) {
- IO.enumCase(Mode, "Pointer", PointerMode::Pointer);
- IO.enumCase(Mode, "LValueReference", PointerMode::LValueReference);
- IO.enumCase(Mode, "PointerToDataMember", PointerMode::PointerToDataMember);
- IO.enumCase(Mode, "PointerToMemberFunction",
- PointerMode::PointerToMemberFunction);
- IO.enumCase(Mode, "RValueReference", PointerMode::RValueReference);
- }
-};
-
-template <> struct ScalarEnumerationTraits<HfaKind> {
- static void enumeration(IO &IO, HfaKind &Value) {
- IO.enumCase(Value, "None", HfaKind::None);
- IO.enumCase(Value, "Float", HfaKind::Float);
- IO.enumCase(Value, "Double", HfaKind::Double);
- IO.enumCase(Value, "Other", HfaKind::Other);
- }
-};
-
-template <> struct ScalarEnumerationTraits<MemberAccess> {
- static void enumeration(IO &IO, MemberAccess &Access) {
- IO.enumCase(Access, "None", MemberAccess::None);
- IO.enumCase(Access, "Private", MemberAccess::Private);
- IO.enumCase(Access, "Protected", MemberAccess::Protected);
- IO.enumCase(Access, "Public", MemberAccess::Public);
- }
-};
-
-template <> struct ScalarEnumerationTraits<MethodKind> {
- static void enumeration(IO &IO, MethodKind &Kind) {
- IO.enumCase(Kind, "Vanilla", MethodKind::Vanilla);
- IO.enumCase(Kind, "Virtual", MethodKind::Virtual);
- IO.enumCase(Kind, "Static", MethodKind::Static);
- IO.enumCase(Kind, "Friend", MethodKind::Friend);
- IO.enumCase(Kind, "IntroducingVirtual", MethodKind::IntroducingVirtual);
- IO.enumCase(Kind, "PureVirtual", MethodKind::PureVirtual);
- IO.enumCase(Kind, "PureIntroducingVirtual",
- MethodKind::PureIntroducingVirtual);
- }
-};
-
-template <> struct ScalarEnumerationTraits<WindowsRTClassKind> {
- static void enumeration(IO &IO, WindowsRTClassKind &Value) {
- IO.enumCase(Value, "None", WindowsRTClassKind::None);
- IO.enumCase(Value, "Ref", WindowsRTClassKind::RefClass);
- IO.enumCase(Value, "Value", WindowsRTClassKind::ValueClass);
- IO.enumCase(Value, "Interface", WindowsRTClassKind::Interface);
- }
-};
-
-template <> struct ScalarBitSetTraits<PointerOptions> {
- static void bitset(IO &IO, PointerOptions &Options) {
- IO.bitSetCase(Options, "None", PointerOptions::None);
- IO.bitSetCase(Options, "Flat32", PointerOptions::Flat32);
- IO.bitSetCase(Options, "Volatile", PointerOptions::Volatile);
- IO.bitSetCase(Options, "Const", PointerOptions::Const);
- IO.bitSetCase(Options, "Unaligned", PointerOptions::Unaligned);
- IO.bitSetCase(Options, "Restrict", PointerOptions::Restrict);
- IO.bitSetCase(Options, "WinRTSmartPointer",
- PointerOptions::WinRTSmartPointer);
- }
-};
-
-template <> struct ScalarBitSetTraits<ModifierOptions> {
- static void bitset(IO &IO, ModifierOptions &Options) {
- IO.bitSetCase(Options, "None", ModifierOptions::None);
- IO.bitSetCase(Options, "Const", ModifierOptions::Const);
- IO.bitSetCase(Options, "Volatile", ModifierOptions::Volatile);
- IO.bitSetCase(Options, "Unaligned", ModifierOptions::Unaligned);
- }
-};
-
-template <> struct ScalarBitSetTraits<FunctionOptions> {
- static void bitset(IO &IO, FunctionOptions &Options) {
- IO.bitSetCase(Options, "None", FunctionOptions::None);
- IO.bitSetCase(Options, "CxxReturnUdt", FunctionOptions::CxxReturnUdt);
- IO.bitSetCase(Options, "Constructor", FunctionOptions::Constructor);
- IO.bitSetCase(Options, "ConstructorWithVirtualBases",
- FunctionOptions::ConstructorWithVirtualBases);
- }
-};
-
-template <> struct ScalarBitSetTraits<ClassOptions> {
- static void bitset(IO &IO, ClassOptions &Options) {
- IO.bitSetCase(Options, "None", ClassOptions::None);
- IO.bitSetCase(Options, "HasConstructorOrDestructor",
- ClassOptions::HasConstructorOrDestructor);
- IO.bitSetCase(Options, "HasOverloadedOperator",
- ClassOptions::HasOverloadedOperator);
- IO.bitSetCase(Options, "Nested", ClassOptions::Nested);
- IO.bitSetCase(Options, "ContainsNestedClass",
- ClassOptions::ContainsNestedClass);
- IO.bitSetCase(Options, "HasOverloadedAssignmentOperator",
- ClassOptions::HasOverloadedAssignmentOperator);
- IO.bitSetCase(Options, "HasConversionOperator",
- ClassOptions::HasConversionOperator);
- IO.bitSetCase(Options, "ForwardReference", ClassOptions::ForwardReference);
- IO.bitSetCase(Options, "Scoped", ClassOptions::Scoped);
- IO.bitSetCase(Options, "HasUniqueName", ClassOptions::HasUniqueName);
- IO.bitSetCase(Options, "Sealed", ClassOptions::Sealed);
- IO.bitSetCase(Options, "Intrinsic", ClassOptions::Intrinsic);
- }
-};
-
-template <> struct ScalarBitSetTraits<MethodOptions> {
- static void bitset(IO &IO, MethodOptions &Options) {
- IO.bitSetCase(Options, "None", MethodOptions::None);
- IO.bitSetCase(Options, "Pseudo", MethodOptions::Pseudo);
- IO.bitSetCase(Options, "NoInherit", MethodOptions::NoInherit);
- IO.bitSetCase(Options, "NoConstruct", MethodOptions::NoConstruct);
- IO.bitSetCase(Options, "CompilerGenerated",
- MethodOptions::CompilerGenerated);
- IO.bitSetCase(Options, "Sealed", MethodOptions::Sealed);
- }
-};
-
-template <> struct ScalarTraits<APSInt> {
- static void output(const APSInt &S, void *, llvm::raw_ostream &OS) {
- S.print(OS, true);
- }
- static StringRef input(StringRef Scalar, void *Ctx, APSInt &S) {
- S = APSInt(Scalar);
- return "";
- }
-
- static bool mustQuote(StringRef Scalar) { return false; }
-};
-
-void MappingTraits<CVType>::mapping(IO &IO, CVType &Record) {
- if (IO.outputting()) {
- codeview::yaml::YamlTypeDumperCallbacks Callbacks(IO);
- codeview::TypeDeserializer Deserializer(Callbacks);
-
- codeview::CVTypeVisitor Visitor(Deserializer);
- consumeError(Visitor.visitTypeRecord(Record));
- }
-}
-
-void MappingTraits<FieldListRecord>::mapping(IO &IO,
- FieldListRecord &FieldList) {
- if (IO.outputting()) {
- codeview::yaml::YamlTypeDumperCallbacks Callbacks(IO);
- codeview::TypeDeserializer Deserializer(Callbacks);
- codeview::CVTypeVisitor Visitor(Deserializer);
- consumeError(Visitor.visitFieldListMemberStream(FieldList.Data));
- }
-}
-
-void MappingTraits<StringIdRecord>::mapping(IO &IO, StringIdRecord &String) {
- IO.mapRequired("Id", String.Id);
- IO.mapRequired("String", String.String);
-}
-
-void MappingTraits<ArgListRecord>::mapping(IO &IO, ArgListRecord &Args) {
- IO.mapRequired("ArgIndices", Args.StringIndices);
-}
-
-void MappingTraits<ClassRecord>::mapping(IO &IO, ClassRecord &Class) {
- IO.mapRequired("MemberCount", Class.MemberCount);
- IO.mapRequired("Options", Class.Options);
- IO.mapRequired("FieldList", Class.FieldList);
- IO.mapRequired("Name", Class.Name);
- IO.mapRequired("UniqueName", Class.UniqueName);
- IO.mapRequired("Hfa", Class.Hfa);
- IO.mapRequired("WinRTKind", Class.WinRTKind);
- IO.mapRequired("DerivationList", Class.DerivationList);
- IO.mapRequired("VTableShape", Class.VTableShape);
- IO.mapRequired("Size", Class.Size);
-}
-
-void MappingTraits<UnionRecord>::mapping(IO &IO, UnionRecord &Union) {
- IO.mapRequired("MemberCount", Union.MemberCount);
- IO.mapRequired("Options", Union.Options);
- IO.mapRequired("FieldList", Union.FieldList);
- IO.mapRequired("Name", Union.Name);
- IO.mapRequired("UniqueName", Union.UniqueName);
- IO.mapRequired("Hfa", Union.Hfa);
- IO.mapRequired("Size", Union.Size);
-}
-
-void MappingTraits<EnumRecord>::mapping(IO &IO, EnumRecord &Enum) {
- IO.mapRequired("NumEnumerators", Enum.MemberCount);
- IO.mapRequired("Options", Enum.Options);
- IO.mapRequired("FieldList", Enum.FieldList);
- IO.mapRequired("Name", Enum.Name);
- IO.mapRequired("UniqueName", Enum.UniqueName);
- IO.mapRequired("UnderlyingType", Enum.UnderlyingType);
-}
-
-void MappingTraits<ArrayRecord>::mapping(IO &IO, ArrayRecord &AT) {
- IO.mapRequired("ElementType", AT.ElementType);
- IO.mapRequired("IndexType", AT.IndexType);
- IO.mapRequired("Size", AT.Size);
- IO.mapRequired("Name", AT.Name);
-}
-
-void MappingTraits<VFTableRecord>::mapping(IO &IO, VFTableRecord &VFT) {
- IO.mapRequired("CompleteClass", VFT.CompleteClass);
- IO.mapRequired("OverriddenVFTable", VFT.OverriddenVFTable);
- IO.mapRequired("VFPtrOffset", VFT.VFPtrOffset);
- IO.mapRequired("Name", VFT.Name);
- IO.mapRequired("MethodNames", VFT.MethodNames);
-}
-
-void MappingTraits<MemberFuncIdRecord>::mapping(IO &IO,
- MemberFuncIdRecord &Id) {
- IO.mapRequired("ClassType", Id.ClassType);
- IO.mapRequired("FunctionType", Id.FunctionType);
- IO.mapRequired("Name", Id.Name);
-}
-
-void MappingTraits<ProcedureRecord>::mapping(IO &IO, ProcedureRecord &Proc) {
- IO.mapRequired("ReturnType", Proc.ReturnType);
- IO.mapRequired("CallConv", Proc.CallConv);
- IO.mapRequired("Options", Proc.Options);
- IO.mapRequired("ParameterCount", Proc.ParameterCount);
- IO.mapRequired("ArgumentList", Proc.ArgumentList);
-}
-
-void MappingTraits<MemberFunctionRecord>::mapping(IO &IO,
- MemberFunctionRecord &MF) {
- IO.mapRequired("ReturnType", MF.ReturnType);
- IO.mapRequired("ClassType", MF.ClassType);
- IO.mapRequired("ThisType", MF.ThisType);
- IO.mapRequired("CallConv", MF.CallConv);
- IO.mapRequired("Options", MF.Options);
- IO.mapRequired("ParameterCount", MF.ParameterCount);
- IO.mapRequired("ArgumentList", MF.ArgumentList);
- IO.mapRequired("ThisPointerAdjustment", MF.ThisPointerAdjustment);
-}
-
-void MappingTraits<MethodOverloadListRecord>::mapping(
- IO &IO, MethodOverloadListRecord &MethodList) {
- IO.mapRequired("Methods", MethodList.Methods);
-}
-
-void MappingTraits<FuncIdRecord>::mapping(IO &IO, FuncIdRecord &Func) {
- IO.mapRequired("ParentScope", Func.ParentScope);
- IO.mapRequired("FunctionType", Func.FunctionType);
- IO.mapRequired("Name", Func.Name);
-}
-
-void MappingTraits<TypeServer2Record>::mapping(IO &IO, TypeServer2Record &TS) {
- IO.mapRequired("Guid", TS.Guid);
- IO.mapRequired("Age", TS.Age);
- IO.mapRequired("Name", TS.Name);
-}
-
-void MappingTraits<PointerRecord>::mapping(IO &IO, PointerRecord &Ptr) {
- IO.mapRequired("ReferentType", Ptr.ReferentType);
- IO.mapRequired("PtrKind", Ptr.PtrKind);
- IO.mapRequired("Mode", Ptr.Mode);
- IO.mapRequired("Options", Ptr.Options);
- IO.mapRequired("Size", Ptr.Size);
- IO.mapOptional("MemberInfo", Ptr.MemberInfo);
-}
-
-void MappingTraits<MemberPointerInfo>::mapping(IO &IO, MemberPointerInfo &MPI) {
- IO.mapRequired("ContainingType", MPI.ContainingType);
- IO.mapRequired("Representation", MPI.Representation);
-}
-
-void MappingTraits<ModifierRecord>::mapping(IO &IO, ModifierRecord &Mod) {
- IO.mapRequired("ModifiedType", Mod.ModifiedType);
- IO.mapRequired("Modifiers", Mod.Modifiers);
-}
-
-void MappingTraits<BitFieldRecord>::mapping(IO &IO, BitFieldRecord &BitField) {
- IO.mapRequired("Type", BitField.Type);
- IO.mapRequired("BitSize", BitField.BitSize);
- IO.mapRequired("BitOffset", BitField.BitOffset);
-}
-
-void MappingTraits<VFTableShapeRecord>::mapping(IO &IO,
- VFTableShapeRecord &Shape) {
- IO.mapRequired("Slots", Shape.Slots);
-}
-
-void MappingTraits<UdtSourceLineRecord>::mapping(IO &IO,
- UdtSourceLineRecord &Line) {
- IO.mapRequired("UDT", Line.UDT);
- IO.mapRequired("SourceFile", Line.SourceFile);
- IO.mapRequired("LineNumber", Line.LineNumber);
-}
-
-void MappingTraits<UdtModSourceLineRecord>::mapping(
- IO &IO, UdtModSourceLineRecord &Line) {
- IO.mapRequired("UDT", Line.UDT);
- IO.mapRequired("SourceFile", Line.SourceFile);
- IO.mapRequired("LineNumber", Line.LineNumber);
- IO.mapRequired("Module", Line.Module);
-}
-
-void MappingTraits<BuildInfoRecord>::mapping(IO &IO, BuildInfoRecord &Args) {
- IO.mapRequired("ArgIndices", Args.ArgIndices);
-}
-
-void MappingTraits<NestedTypeRecord>::mapping(IO &IO,
- NestedTypeRecord &Nested) {
- IO.mapRequired("Type", Nested.Type);
- IO.mapRequired("Name", Nested.Name);
-}
-
-void MappingTraits<OneMethodRecord>::mapping(IO &IO, OneMethodRecord &Method) {
- IO.mapRequired("Type", Method.Type);
- IO.mapRequired("Kind", Method.Kind);
- IO.mapRequired("Options", Method.Options);
- IO.mapRequired("Access", Method.Access);
- IO.mapRequired("VFTableOffset", Method.VFTableOffset);
- IO.mapRequired("Name", Method.Name);
-}
-
-void MappingTraits<OverloadedMethodRecord>::mapping(
- IO &IO, OverloadedMethodRecord &Method) {
- IO.mapRequired("NumOverloads", Method.NumOverloads);
- IO.mapRequired("MethodList", Method.MethodList);
- IO.mapRequired("Name", Method.Name);
-}
-
-void MappingTraits<DataMemberRecord>::mapping(IO &IO, DataMemberRecord &Field) {
- IO.mapRequired("Access", Field.Access);
- IO.mapRequired("Type", Field.Type);
- IO.mapRequired("FieldOffset", Field.FieldOffset);
- IO.mapRequired("Name", Field.Name);
-}
-
-void MappingTraits<StaticDataMemberRecord>::mapping(
- IO &IO, StaticDataMemberRecord &Field) {
- IO.mapRequired("Access", Field.Access);
- IO.mapRequired("Type", Field.Type);
- IO.mapRequired("Name", Field.Name);
-}
-
-void MappingTraits<VFPtrRecord>::mapping(IO &IO, VFPtrRecord &VFTable) {
- IO.mapRequired("Type", VFTable.Type);
-}
-
-void MappingTraits<EnumeratorRecord>::mapping(IO &IO, EnumeratorRecord &Enum) {
- IO.mapRequired("Access", Enum.Access);
- IO.mapRequired("Value", Enum.Value);
- IO.mapRequired("Name", Enum.Name);
-}
-
-void MappingTraits<BaseClassRecord>::mapping(IO &IO, BaseClassRecord &Base) {
- IO.mapRequired("Access", Base.Access);
- IO.mapRequired("Type", Base.Type);
- IO.mapRequired("Offset", Base.Offset);
-}
-
-void MappingTraits<VirtualBaseClassRecord>::mapping(
- IO &IO, VirtualBaseClassRecord &Base) {
- IO.mapRequired("Access", Base.Access);
- IO.mapRequired("BaseType", Base.BaseType);
- IO.mapRequired("VBPtrType", Base.VBPtrType);
- IO.mapRequired("VBPtrOffset", Base.VBPtrOffset);
- IO.mapRequired("VTableIndex", Base.VTableIndex);
-}
-
-void MappingTraits<ListContinuationRecord>::mapping(
- IO &IO, ListContinuationRecord &Cont) {
- IO.mapRequired("ContinuationIndex", Cont.ContinuationIndex);
-}
-
-template <> struct ScalarTraits<codeview::TypeIndex> {
- static void output(const codeview::TypeIndex &S, void *,
- llvm::raw_ostream &OS) {
- OS << S.getIndex();
- }
- static StringRef input(StringRef Scalar, void *Ctx, codeview::TypeIndex &S) {
- uint32_t I;
- StringRef Result = ScalarTraits<uint32_t>::input(Scalar, Ctx, I);
- if (!Result.empty())
- return Result;
- S = TypeIndex(I);
- return "";
- }
- static bool mustQuote(StringRef Scalar) { return false; }
-};
-
-void ScalarEnumerationTraits<TypeLeafKind>::enumeration(IO &io,
- TypeLeafKind &Value) {
- auto TypeLeafNames = getTypeLeafNames();
- for (const auto &E : TypeLeafNames)
- io.enumCase(Value, E.Name.str().c_str(), E.Value);
-}
-}
-}
-
-Error llvm::codeview::yaml::YamlTypeDumperCallbacks::visitTypeBegin(
- const CVRecord<TypeLeafKind> &CVR) {
- TypeLeafKind K = CVR.Type;
- YamlIO.mapRequired("Kind", K);
- return Error::success();
-}
+++ /dev/null
-//===- PdbYAML.h ---------------------------------------------- *- C++ --*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVMPDBDUMP_CODEVIEWYAML_H
-#define LLVM_TOOLS_LLVMPDBDUMP_CODEVIEWYAML_H
-
-#include "llvm/DebugInfo/CodeView/CodeView.h"
-#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
-#include "llvm/Support/YAMLTraits.h"
-
-namespace llvm {
-namespace codeview {
-namespace yaml {
-class YamlTypeDumperCallbacks : public TypeVisitorCallbacks {
-public:
- YamlTypeDumperCallbacks(llvm::yaml::IO &IO) : YamlIO(IO) {}
-
- virtual Error visitTypeBegin(const CVRecord<TypeLeafKind> &Record) override;
-
-#define TYPE_RECORD(EnumName, EnumVal, Name) \
- Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR, \
- Name##Record &Record) override { \
- YamlIO.mapRequired(#Name, Record); \
- return Error::success(); \
- }
-#define MEMBER_RECORD(EnumName, EnumVal, Name) \
- TYPE_RECORD(EnumName, EnumVal, Name)
-#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
-#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
-#include "llvm/DebugInfo/CodeView/TypeRecords.def"
-
-private:
- llvm::yaml::IO &YamlIO;
-};
-}
-}
-}
-
-namespace llvm {
-namespace yaml {
-template <> struct MappingTraits<codeview::MemberPointerInfo> {
- static void mapping(IO &IO, codeview::MemberPointerInfo &Obj);
-};
-
-template <> struct MappingTraits<codeview::CVType> {
- static void mapping(IO &IO, codeview::CVType &Obj);
-};
-
-template <> struct ScalarEnumerationTraits<codeview::TypeLeafKind> {
- static void enumeration(IO &io, codeview::TypeLeafKind &Value);
-};
-
-#define TYPE_RECORD(EnumName, EnumVal, Name) \
- template <> struct MappingTraits<codeview::Name##Record> { \
- static void mapping(IO &IO, codeview::Name##Record &Obj); \
- };
-#define MEMBER_RECORD(EnumName, EnumVal, Name) \
- TYPE_RECORD(EnumName, EnumVal, Name)
-#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
-#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
-#include "llvm/DebugInfo/CodeView/TypeRecords.def"
-}
-}
-
-#endif
//===----------------------------------------------------------------------===//
#include "PdbYaml.h"
-#include "CodeViewYaml.h"
-#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
-#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
#include "llvm/DebugInfo/PDB/PDBExtras.h"
-#include "llvm/DebugInfo/PDB/PDBTypes.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
using namespace llvm;
+using namespace llvm::msf;
+using namespace llvm::yaml;
using namespace llvm::pdb;
using namespace llvm::pdb::yaml;
-using namespace llvm::yaml;
-
-LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t)
-LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef)
-LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::NamedStreamMapping)
-LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbDbiModuleInfo)
-LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbTpiRecord)
-LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::StreamBlockList)
namespace llvm {
namespace yaml {
-
template <> struct ScalarTraits<llvm::pdb::PDB_UniqueId> {
static void output(const llvm::pdb::PDB_UniqueId &S, void *,
llvm::raw_ostream &OS) {
io.enumCase(Value, "VC140", llvm::pdb::PdbRaw_ImplVer::PdbImplVC140);
}
};
-
-template <> struct ScalarEnumerationTraits<llvm::pdb::PdbRaw_TpiVer> {
- static void enumeration(IO &io, llvm::pdb::PdbRaw_TpiVer &Value) {
- io.enumCase(Value, "VC40", llvm::pdb::PdbRaw_TpiVer::PdbTpiV40);
- io.enumCase(Value, "VC41", llvm::pdb::PdbRaw_TpiVer::PdbTpiV41);
- io.enumCase(Value, "VC50", llvm::pdb::PdbRaw_TpiVer::PdbTpiV50);
- io.enumCase(Value, "VC70", llvm::pdb::PdbRaw_TpiVer::PdbTpiV70);
- io.enumCase(Value, "VC80", llvm::pdb::PdbRaw_TpiVer::PdbTpiV80);
- }
-};
}
}
IO.mapOptional("StreamMap", Obj.StreamMap);
IO.mapOptional("PdbStream", Obj.PdbStream);
IO.mapOptional("DbiStream", Obj.DbiStream);
- IO.mapOptional("TpiStream", Obj.TpiStream);
}
void MappingTraits<MSFHeaders>::mapping(IO &IO, MSFHeaders &Obj) {
IO.mapOptional("Modules", Obj.ModInfos);
}
-void MappingTraits<PdbTpiStream>::mapping(IO &IO,
- pdb::yaml::PdbTpiStream &Obj) {
- IO.mapRequired("Version", Obj.Version);
- IO.mapRequired("Records", Obj.Records);
-}
-
void MappingTraits<NamedStreamMapping>::mapping(IO &IO,
NamedStreamMapping &Obj) {
IO.mapRequired("Name", Obj.StreamName);
IO.mapRequired("ObjFile", Obj.Obj);
IO.mapOptional("SourceFiles", Obj.SourceFiles);
}
-
-void MappingTraits<PdbTpiRecord>::mapping(IO &IO,
- pdb::yaml::PdbTpiRecord &Obj) {
- if (IO.outputting()) {
- // If we're going from Pdb To Yaml, deserialize the Pdb record
- codeview::yaml::YamlTypeDumperCallbacks Callbacks(IO);
- codeview::TypeDeserializer Deserializer(Callbacks);
-
- codeview::CVTypeVisitor Visitor(Deserializer);
- consumeError(Visitor.visitTypeRecord(Obj.Record));
- } else {
- codeview::yaml::YamlTypeDumperCallbacks Callbacks(IO);
- codeview::CVTypeVisitor Visitor(Callbacks);
- consumeError(Visitor.visitTypeRecord(Obj.Record));
- }
-}
std::vector<PdbDbiModuleInfo> ModInfos;
};
-struct PdbTpiRecord {
- std::vector<uint8_t> RecordData;
- codeview::CVType Record;
-};
-
-struct PdbTpiStream {
- PdbRaw_TpiVer Version;
- std::vector<PdbTpiRecord> Records;
-};
-
struct PdbObject {
Optional<MSFHeaders> Headers;
Optional<std::vector<uint32_t>> StreamSizes;
Optional<std::vector<StreamBlockList>> StreamMap;
Optional<PdbInfoStream> PdbStream;
Optional<PdbDbiStream> DbiStream;
- Optional<PdbTpiStream> TpiStream;
};
}
}
static void mapping(IO &IO, pdb::yaml::PdbDbiStream &Obj);
};
-template <> struct MappingTraits<pdb::yaml::PdbTpiStream> {
- static void mapping(IO &IO, pdb::yaml::PdbTpiStream &Obj);
-};
-
template <> struct MappingTraits<pdb::yaml::NamedStreamMapping> {
static void mapping(IO &IO, pdb::yaml::NamedStreamMapping &Obj);
};
template <> struct MappingTraits<pdb::yaml::PdbDbiModuleInfo> {
static void mapping(IO &IO, pdb::yaml::PdbDbiModuleInfo &Obj);
};
-
-template <> struct MappingTraits<pdb::yaml::PdbTpiRecord> {
- static void mapping(IO &IO, pdb::yaml::PdbTpiRecord &Obj);
-};
}
}
+LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t)
+LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef)
+LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::NamedStreamMapping)
+LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbDbiModuleInfo)
+LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::StreamBlockList)
+
#endif // LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
#include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
-#include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
using namespace llvm;
using namespace llvm::pdb;
if (auto EC = dumpDbiStream())
return EC;
- if (auto EC = dumpTpiStream())
- return EC;
-
flush();
return Error::success();
}
return Error::success();
}
-Error YAMLOutputStyle::dumpTpiStream() {
- if (!opts::pdb2yaml::TpiStream)
- return Error::success();
-
- auto TpiS = File.getPDBTpiStream();
- if (!TpiS)
- return TpiS.takeError();
-
- auto &TS = TpiS.get();
- Obj.TpiStream.emplace();
- Obj.TpiStream->Version = TS.getTpiVersion();
- for (auto &Record : TS.types(nullptr)) {
- yaml::PdbTpiRecord R;
- // It's not necessary to set R.RecordData here. That only exists as a
- // way to have the `PdbTpiRecord` structure own the memory that `R.Record`
- // references. In the case of reading an existing PDB though, that memory
- // is owned by the backing stream.
- R.Record = Record;
- Obj.TpiStream->Records.push_back(R);
- }
-
- return Error::success();
-}
-
void YAMLOutputStyle::flush() {
Out << Obj;
outs().flush();
Error dumpStreamDirectory();
Error dumpPDBStream();
Error dumpDbiStream();
- Error dumpTpiStream();
void flush();
"Dump DBI Module Source File Information (implies -dbi-module-info"),
cl::sub(PdbToYamlSubcommand), cl::init(false));
-cl::opt<bool> TpiStream("tpi-stream",
- cl::desc("Dump the TPI Stream (Stream 3)"),
- cl::sub(PdbToYamlSubcommand), cl::init(false));
-
cl::list<std::string> InputFilename(cl::Positional,
cl::desc("<input PDB file>"), cl::Required,
cl::sub(PdbToYamlSubcommand));
cl::ParseCommandLineOptions(argv.size(), argv.data(), "LLVM PDB Dumper\n");
- if (opts::RawSubcommand && opts::raw::RawAll) {
+ // These options are shared by two subcommands.
+ if ((opts::PdbToYamlSubcommand || opts::RawSubcommand) && opts::raw::RawAll) {
opts::raw::DumpHeaders = true;
opts::raw::DumpModules = true;
opts::raw::DumpModuleFiles = true;
extern llvm::cl::opt<bool> DbiStream;
extern llvm::cl::opt<bool> DbiModuleInfo;
extern llvm::cl::opt<bool> DbiModuleSourceFileInfo;
-extern llvm::cl::opt<bool> TpiStream;
extern llvm::cl::list<std::string> InputFilename;
}
}