LLVM  7.0.0svn
PDBTypes.h
Go to the documentation of this file.
1 //===- PDBTypes.h - Defines enums for various fields contained in PDB ----====//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_PDB_PDBTYPES_H
11 #define LLVM_DEBUGINFO_PDB_PDBTYPES_H
12 
16 #include <cctype>
17 #include <cstddef>
18 #include <cstdint>
19 #include <cstring>
20 #include <functional>
21 
22 namespace llvm {
23 namespace pdb {
24 
25 class IPDBDataStream;
26 class IPDBLineNumber;
27 class IPDBSourceFile;
28 class IPDBTable;
29 class PDBSymDumper;
30 class PDBSymbol;
31 class PDBSymbolExe;
32 class PDBSymbolCompiland;
33 class PDBSymbolCompilandDetails;
34 class PDBSymbolCompilandEnv;
35 class PDBSymbolFunc;
36 class PDBSymbolBlock;
37 class PDBSymbolData;
38 class PDBSymbolAnnotation;
39 class PDBSymbolLabel;
40 class PDBSymbolPublicSymbol;
41 class PDBSymbolTypeUDT;
42 class PDBSymbolTypeEnum;
43 class PDBSymbolTypeFunctionSig;
44 class PDBSymbolTypePointer;
45 class PDBSymbolTypeArray;
46 class PDBSymbolTypeBuiltin;
47 class PDBSymbolTypeTypedef;
48 class PDBSymbolTypeBaseClass;
49 class PDBSymbolTypeFriend;
50 class PDBSymbolTypeFunctionArg;
51 class PDBSymbolFuncDebugStart;
52 class PDBSymbolFuncDebugEnd;
53 class PDBSymbolUsingNamespace;
54 class PDBSymbolTypeVTableShape;
55 class PDBSymbolTypeVTable;
56 class PDBSymbolCustom;
57 class PDBSymbolThunk;
58 class PDBSymbolTypeCustom;
59 class PDBSymbolTypeManaged;
60 class PDBSymbolTypeDimension;
61 class PDBSymbolUnknown;
62 
68 
69 /// Specifies which PDB reader implementation is to be used. Only a value
70 /// of PDB_ReaderType::DIA is currently supported, but Native is in the works.
71 enum class PDB_ReaderType {
72  DIA = 0,
73  Native = 1,
74 };
75 
76 /// An enumeration indicating the type of data contained in this table.
77 enum class PDB_TableType {
78  TableInvalid = 0,
79  Symbols,
83  Segments,
85  FrameData,
87  Dbg
88 };
89 
90 /// Defines flags used for enumerating child symbols. This corresponds to the
91 /// NameSearchOptions enumeration which is documented here:
92 /// https://msdn.microsoft.com/en-us/library/yat28ads.aspx
94  NS_Default = 0x0,
98  NS_Regex = 0x8,
100 };
101 
102 /// Specifies the hash algorithm that a source file from a PDB was hashed with.
103 /// This corresponds to the CV_SourceChksum_t enumeration and are documented
104 /// here: https://msdn.microsoft.com/en-us/library/e96az21x.aspx
105 enum class PDB_Checksum { None = 0, MD5 = 1, SHA1 = 2 };
106 
107 /// These values correspond to the CV_CPU_TYPE_e enumeration, and are documented
108 /// here: https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
110 
111 enum class PDB_Machine {
112  Invalid = 0xffff,
113  Unknown = 0x0,
114  Am33 = 0x13,
115  Amd64 = 0x8664,
116  Arm = 0x1C0,
117  ArmNT = 0x1C4,
118  Ebc = 0xEBC,
119  x86 = 0x14C,
120  Ia64 = 0x200,
121  M32R = 0x9041,
122  Mips16 = 0x266,
123  MipsFpu = 0x366,
124  MipsFpu16 = 0x466,
125  PowerPC = 0x1F0,
126  PowerPCFP = 0x1F1,
127  R4000 = 0x166,
128  SH3 = 0x1A2,
129  SH3DSP = 0x1A3,
130  SH4 = 0x1A6,
131  SH5 = 0x1A8,
132  Thumb = 0x1C2,
133  WceMipsV2 = 0x169
134 };
135 
136 /// These values correspond to the CV_call_e enumeration, and are documented
137 /// at the following locations:
138 /// https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
139 /// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx
141 
142 /// These values correspond to the CV_CFL_LANG enumeration, and are documented
143 /// here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx
145 
146 /// These values correspond to the DataKind enumeration, and are documented
147 /// here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx
148 enum class PDB_DataKind {
149  Unknown,
150  Local,
151  StaticLocal,
152  Param,
153  ObjectPtr,
154  FileStatic,
155  Global,
156  Member,
157  StaticMember,
158  Constant
159 };
160 
161 /// These values correspond to the SymTagEnum enumeration, and are documented
162 /// here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx
163 enum class PDB_SymType {
164  None,
165  Exe,
166  Compiland,
168  CompilandEnv,
169  Function,
170  Block,
171  Data,
172  Annotation,
173  Label,
174  PublicSymbol,
175  UDT,
176  Enum,
177  FunctionSig,
178  PointerType,
179  ArrayType,
180  BuiltinType,
181  Typedef,
182  BaseClass,
183  Friend,
184  FunctionArg,
186  FuncDebugEnd,
188  VTableShape,
189  VTable,
190  Custom,
191  Thunk,
192  CustomType,
193  ManagedType,
194  Dimension,
195  Max
196 };
197 
198 /// These values correspond to the LocationType enumeration, and are documented
199 /// here: https://msdn.microsoft.com/en-us/library/f57kaez3.aspx
200 enum class PDB_LocType {
201  Null,
202  Static,
203  TLS,
204  RegRel,
205  ThisRel,
206  Enregistered,
207  BitField,
208  Slot,
209  IlRel,
210  MetaData,
211  Constant,
212  Max
213 };
214 
215 /// These values correspond to the UdtKind enumeration, and are documented
216 /// here: https://msdn.microsoft.com/en-us/library/wcstk66t.aspx
218 
219 /// These values correspond to the StackFrameTypeEnum enumeration, and are
220 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
222 
223 /// These values correspond to the StackFrameTypeEnum enumeration, and are
224 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
226 
227 /// These values correspond to the Basictype enumeration, and are documented
228 /// here: https://msdn.microsoft.com/en-us/library/4szdtzc3.aspx
229 enum class PDB_BuiltinType {
230  None = 0,
231  Void = 1,
232  Char = 2,
233  WCharT = 3,
234  Int = 6,
235  UInt = 7,
236  Float = 8,
237  BCD = 9,
238  Bool = 10,
239  Long = 13,
240  ULong = 14,
241  Currency = 25,
242  Date = 26,
243  Variant = 27,
244  Complex = 28,
245  Bitfield = 29,
246  BSTR = 30,
247  HResult = 31
248 };
249 
250 /// These values correspond to the flags that can be combined to control the
251 /// return of an undecorated name for a C++ decorated name, and are documented
252 /// here: https://msdn.microsoft.com/en-us/library/kszfk0fs.aspx
271  Undname_NoECSU = 0x8000,
273  Undname_NoPTR64 = 0x20000
274 };
275 
276 enum class PDB_MemberAccess { Private = 1, Protected = 2, Public = 3 };
277 
278 struct VersionInfo {
283 };
284 
300 };
301 
302 struct Variant {
303  Variant() = default;
304 
305  Variant(const Variant &Other) {
306  *this = Other;
307  }
308 
311  delete[] Value.String;
312  }
313 
315  union {
316  bool Bool;
317  int8_t Int8;
318  int16_t Int16;
319  int32_t Int32;
320  int64_t Int64;
321  float Single;
322  double Double;
323  uint8_t UInt8;
324  uint16_t UInt16;
326  uint64_t UInt64;
327  char *String;
328  } Value;
329 
330 #define VARIANT_EQUAL_CASE(Enum) \
331  case PDB_VariantType::Enum: \
332  return Value.Enum == Other.Value.Enum;
333 
334  bool operator==(const Variant &Other) const {
335  if (Type != Other.Type)
336  return false;
337  switch (Type) {
350  default:
351  return true;
352  }
353  }
354 
355 #undef VARIANT_EQUAL_CASE
356 
357  bool operator!=(const Variant &Other) const { return !(*this == Other); }
358  Variant &operator=(const Variant &Other) {
359  if (this == &Other)
360  return *this;
361  if (Type == PDB_VariantType::String)
362  delete[] Value.String;
363  Type = Other.Type;
364  Value = Other.Value;
365  if (Other.Type == PDB_VariantType::String &&
366  Other.Value.String != nullptr) {
367  Value.String = new char[strlen(Other.Value.String) + 1];
368  ::strcpy(Value.String, Other.Value.String);
369  }
370  return *this;
371  }
372 };
373 
374 } // end namespace pdb
375 } // end namespace llvm
376 
377 namespace std {
378 
379 template <> struct hash<llvm::pdb::PDB_SymType> {
381  using result_type = std::size_t;
382 
384  return std::hash<int>()(static_cast<int>(Arg));
385  }
386 };
387 
388 } // end namespace std
389 
390 #endif // LLVM_DEBUGINFO_PDB_PDBTYPES_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
PDB_UdtType
These values correspond to the UdtKind enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/wcstk66t.aspx.
Definition: PDBTypes.h:217
result_type operator()(const argument_type &Arg) const
Definition: PDBTypes.h:383
PDB_NameSearchFlags
Defines flags used for enumerating child symbols.
Definition: PDBTypes.h:93
PDB_ReaderType
Specifies which PDB reader implementation is to be used.
Definition: PDBTypes.h:71
A class that wrap the SHA1 algorithm.
Definition: SHA1.h:29
bool operator!=(const Variant &Other) const
Definition: PDBTypes.h:357
PDB_Checksum
Specifies the hash algorithm that a source file from a PDB was hashed with.
Definition: PDBTypes.h:105
PDB_MemoryType
These values correspond to the StackFrameTypeEnum enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:225
Definition: BitVector.h:920
PDB_UndnameFlags
These values correspond to the flags that can be combined to control the return of an undecorated nam...
Definition: PDBTypes.h:253
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx.
Definition: PDBTypes.h:163
uint32_t UInt32
Definition: PDBTypes.h:325
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
This is an important base class in LLVM.
Definition: Constant.h:42
PDB_DataKind
These values correspond to the DataKind enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx.
Definition: PDBTypes.h:148
#define VARIANT_EQUAL_CASE(Enum)
Definition: PDBTypes.h:330
PDB_LocType
These values correspond to the LocationType enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:200
uint64_t UInt64
Definition: PDBTypes.h:326
SourceLanguage
These values correspond to the CV_CFL_LANG enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx.
Definition: CodeView.h:144
Variant(const Variant &Other)
Definition: PDBTypes.h:305
union llvm::pdb::Variant::@188 Value
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
Definition: CodeView.h:79
PDB_TableType
An enumeration indicating the type of data contained in this table.
Definition: PDBTypes.h:77
PDB_VariantType
Definition: PDBTypes.h:285
amdgpu Simplify well known AMD library false Value Value * Arg
PDB_StackFrameType
These values correspond to the StackFrameTypeEnum enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:221
uint16_t UInt16
Definition: PDBTypes.h:324
Definition: MD5.h:41
PDB_BuiltinType
These values correspond to the Basictype enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/4szdtzc3.aspx.
Definition: PDBTypes.h:229
LLVM Value Representation.
Definition: Value.h:73
CallingConvention
These values correspond to the CV_call_e enumeration, and are documented at the following locations: ...
Definition: CodeView.h:173
Variant & operator=(const Variant &Other)
Definition: PDBTypes.h:358
bool operator==(const Variant &Other) const
Definition: PDBTypes.h:334
PDB_VariantType Type
Definition: PDBTypes.h:314
PDB_MemberAccess
Definition: PDBTypes.h:276