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