1 //===- PDBTypes.h - Defines enums for various fields contained in PDB ---*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_PDBTYPES_H
11 #define LLVM_DEBUGINFO_PDB_PDBTYPES_H
13 #include "llvm/Config/llvm-config.h"
23 template <class T> class IPDBEnumChildren;
29 typedef IPDBEnumChildren<PDBSymbol> IPDBEnumSymbols;
30 typedef IPDBEnumChildren<IPDBSourceFile> IPDBEnumSourceFiles;
31 typedef IPDBEnumChildren<IPDBDataStream> IPDBEnumDataStreams;
32 typedef IPDBEnumChildren<IPDBLineNumber> IPDBEnumLineNumbers;
35 class PDBSymbolCompiland;
36 class PDBSymbolCompilandDetails;
37 class PDBSymbolCompilandEnv;
41 class PDBSymbolAnnotation;
43 class PDBSymbolPublicSymbol;
44 class PDBSymbolTypeUDT;
45 class PDBSymbolTypeEnum;
46 class PDBSymbolTypeFunctionSig;
47 class PDBSymbolTypePointer;
48 class PDBSymbolTypeArray;
49 class PDBSymbolTypeBuiltin;
50 class PDBSymbolTypeTypedef;
51 class PDBSymbolTypeBaseClass;
52 class PDBSymbolTypeFriend;
53 class PDBSymbolTypeFunctionArg;
54 class PDBSymbolFuncDebugStart;
55 class PDBSymbolFuncDebugEnd;
56 class PDBSymbolUsingNamespace;
57 class PDBSymbolTypeVTableShape;
58 class PDBSymbolTypeVTable;
59 class PDBSymbolCustom;
61 class PDBSymbolTypeCustom;
62 class PDBSymbolTypeManaged;
63 class PDBSymbolTypeDimension;
64 class PDBSymbolUnknown;
66 /// Specifies which PDB reader implementation is to be used. Only a value
67 /// of PDB_ReaderType::DIA is supported.
68 enum class PDB_ReaderType {
72 /// Defines a 128-bit unique identifier. This maps to a GUID on Windows, but
73 /// is abstracted here for the purposes of non-Windows platforms that don't have
74 /// the GUID structure defined.
80 /// An enumeration indicating the type of data contained in this table.
81 enum class PDB_TableType {
91 /// Defines flags used for enumerating child symbols. This corresponds to the
92 /// NameSearchOptions enumeration which is documented here:
93 /// https://msdn.microsoft.com/en-us/library/yat28ads.aspx
94 enum PDB_NameSearchFlags {
96 NS_CaseSensitive = 0x1,
97 NS_CaseInsensitive = 0x2,
98 NS_FileNameExtMatch = 0x4,
100 NS_UndecoratedName = 0x10
103 /// Specifies the hash algorithm that a source file from a PDB was hashed with.
104 /// This corresponds to the CV_SourceChksum_t enumeration and are documented
105 /// here: https://msdn.microsoft.com/en-us/library/e96az21x.aspx
106 enum class PDB_Checksum { None = 0, MD5 = 1, SHA1 = 2 };
108 /// These values correspond to the CV_CPU_TYPE_e enumeration, and are documented
109 /// here: https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
169 D3D11_Shader = 0x100,
172 enum class PDB_Machine {
197 /// These values correspond to the CV_call_e enumeration, and are documented
198 /// at the following locations:
199 /// https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
200 /// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx
202 enum class PDB_CallingConv {
227 NearVectorcall = 0x18,
231 /// These values correspond to the CV_CFL_LANG enumeration, and are documented
232 /// here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx
233 enum class PDB_Lang {
253 /// These values correspond to the DataKind enumeration, and are documented
254 /// here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx
255 enum class PDB_DataKind {
268 /// These values correspond to the SymTagEnum enumeration, and are documented
269 /// here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx
270 enum class PDB_SymType {
305 /// These values correspond to the LocationType enumeration, and are documented
306 /// here: https://msdn.microsoft.com/en-us/library/f57kaez3.aspx
307 enum class PDB_LocType {
322 /// These values correspond to the THUNK_ORDINAL enumeration, and are documented
323 /// here: https://msdn.microsoft.com/en-us/library/dh0k8hft.aspx
324 enum class PDB_ThunkOrdinal {
334 /// These values correspond to the UdtKind enumeration, and are documented
335 /// here: https://msdn.microsoft.com/en-us/library/wcstk66t.aspx
336 enum class PDB_UdtType { Struct, Class, Union, Interface };
338 /// These values correspond to the StackFrameTypeEnum enumeration, and are
339 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
340 enum class PDB_StackFrameType { FPO, KernelTrap, KernelTSS, EBP, FrameData };
342 /// These values correspond to the StackFrameTypeEnum enumeration, and are
343 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
344 enum class PDB_MemoryType { Code, Data, Stack, HeapCode };
346 /// These values correspond to the Basictype enumeration, and are documented
347 /// here: https://msdn.microsoft.com/en-us/library/4szdtzc3.aspx
348 enum class PDB_BuiltinType {
369 enum class PDB_RegisterId {
421 enum class PDB_MemberAccess { Private = 1, Protected = 2, Public = 3 };
423 enum class PDB_ErrorCode {
442 enum PDB_VariantType {
460 : Type(PDB_VariantType::Empty) {
463 PDB_VariantType Type;
477 #define VARIANT_EQUAL_CASE(Enum) \
478 case PDB_VariantType::Enum: \
479 return Enum == Other.Enum;
480 bool operator==(const Variant &Other) const {
481 if (Type != Other.Type)
484 VARIANT_EQUAL_CASE(Bool)
485 VARIANT_EQUAL_CASE(Int8)
486 VARIANT_EQUAL_CASE(Int16)
487 VARIANT_EQUAL_CASE(Int32)
488 VARIANT_EQUAL_CASE(Int64)
489 VARIANT_EQUAL_CASE(Single)
490 VARIANT_EQUAL_CASE(Double)
491 VARIANT_EQUAL_CASE(UInt8)
492 VARIANT_EQUAL_CASE(UInt16)
493 VARIANT_EQUAL_CASE(UInt32)
494 VARIANT_EQUAL_CASE(UInt64)
499 #undef VARIANT_EQUAL_CASE
500 bool operator!=(const Variant &Other) const { return !(*this == Other); }
506 template <> struct hash<llvm::PDB_SymType> {
507 typedef llvm::PDB_SymType argument_type;
508 typedef std::size_t result_type;
510 result_type operator()(const argument_type &Arg) const {
511 return std::hash<int>()(static_cast<int>(Arg));