Some cleanup for libpdb.
[oota-llvm.git] / include / llvm / DebugInfo / PDB / PDBTypes.h
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
13 #include <stdint.h>
14
15 namespace llvm {
16
17 class PDBSymbol;
18 class PDBSymbolCompiland;
19 class PDBSymbolFunc;
20 class PDBSymbolExe;
21
22 class IPDBDataStream;
23 template <class T> class IPDBEnumChildren;
24 class IPDBRawSymbol;
25 class IPDBSession;
26 class IPDBSourceFile;
27
28 typedef IPDBEnumChildren<PDBSymbol> IPDBEnumSymbols;
29 typedef IPDBEnumChildren<IPDBSourceFile> IPDBEnumSourceFiles;
30 typedef IPDBEnumChildren<IPDBDataStream> IPDBEnumDataStreams;
31 typedef IPDBEnumChildren<PDBSymbolCompiland> IPDBEnumCompilands;
32
33 class PDBSymbolExe;
34 class PDBSymbolCompiland;
35 class PDBSymbolCompilandDetails;
36 class PDBSymbolCompilandEnv;
37 class PDBSymbolFunc;
38 class PDBSymbolBlock;
39 class PDBSymbolData;
40 class PDBSymbolAnnotation;
41 class PDBSymbolLabel;
42 class PDBSymbolPublicSymbol;
43 class PDBSymbolTypeUDT;
44 class PDBSymbolTypeEnum;
45 class PDBSymbolTypeFunctionSig;
46 class PDBSymbolTypePointer;
47 class PDBSymbolTypeArray;
48 class PDBSymbolTypeBuiltin;
49 class PDBSymbolTypeTypedef;
50 class PDBSymbolTypeBaseClass;
51 class PDBSymbolTypeFriend;
52 class PDBSymbolTypeFunctionArg;
53 class PDBSymbolFuncDebugStart;
54 class PDBSymbolFuncDebugEnd;
55 class PDBSymbolUsingNamespace;
56 class PDBSymbolTypeVTableShape;
57 class PDBSymbolTypeVTable;
58 class PDBSymbolCustom;
59 class PDBSymbolThunk;
60 class PDBSymbolTypeCustom;
61 class PDBSymbolTypeManaged;
62 class PDBSymbolTypeDimension;
63 class PDBSymbolUnknown;
64
65 /// Specifies which PDB reader implementation is to be used.  Only a value
66 /// of PDB_ReaderType::DIA is supported.
67 enum class PDB_ReaderType {
68   SystemDefault = 0,
69 #if defined(_MSC_VER)
70   DIA = 1,
71 #endif
72 };
73
74 /// Defines a 128-bit unique identifier.  This maps to a GUID on Windows, but
75 /// is abstracted here for the purposes of non-Windows platforms that don't have
76 /// the GUID structure defined.
77 struct PDB_UniqueId {
78   uint64_t HighPart;
79   uint64_t LowPart;
80 };
81
82 /// An enumeration indicating the type of data contained in this table.
83 enum class PDB_TableType {
84   Symbols,
85   SourceFiles,
86   LineNumbers,
87   SectionContribs,
88   Segments,
89   InjectedSources,
90   FrameData
91 };
92
93 /// Defines flags used for enumerating child symbols.  This corresponds to the
94 /// NameSearchOptions enumeration which is documented here:
95 /// https://msdn.microsoft.com/en-us/library/yat28ads.aspx
96 enum PDB_NameSearchFlags {
97   NS_Default = 0x0,
98   NS_CaseSensitive = 0x1,
99   NS_CaseInsensitive = 0x2,
100   NS_FileNameExtMatch = 0x4,
101   NS_Regex = 0x8,
102   NS_UndecoratedName = 0x10
103 };
104
105 /// Specifies the hash algorithm that a source file from a PDB was hashed with.
106 /// This corresponds to the CV_SourceChksum_t enumeration and are documented
107 /// here: https://msdn.microsoft.com/en-us/library/e96az21x.aspx
108 enum class PDB_Checksum { None = 0, MD5 = 1, SHA1 = 2 };
109
110 /// These values correspond to the CV_CPU_TYPE_e enumeration, and are documented
111 /// here: https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
112 enum class PDB_Cpu {
113   Intel8080 = 0x0,
114   Intel8086 = 0x1,
115   Intel80286 = 0x2,
116   Intel80386 = 0x3,
117   Intel80486 = 0x4,
118   Pentium = 0x5,
119   PentiumPro = 0x6,
120   Pentium3 = 0x7,
121   MIPS = 0x10,
122   MIPS16 = 0x11,
123   MIPS32 = 0x12,
124   MIPS64 = 0x13,
125   MIPSI = 0x14,
126   MIPSII = 0x15,
127   MIPSIII = 0x16,
128   MIPSIV = 0x17,
129   MIPSV = 0x18,
130   M68000 = 0x20,
131   M68010 = 0x21,
132   M68020 = 0x22,
133   M68030 = 0x23,
134   M68040 = 0x24,
135   Alpha = 0x30,
136   Alpha21164 = 0x31,
137   Alpha21164A = 0x32,
138   Alpha21264 = 0x33,
139   Alpha21364 = 0x34,
140   PPC601 = 0x40,
141   PPC603 = 0x41,
142   PPC604 = 0x42,
143   PPC620 = 0x43,
144   PPCFP = 0x44,
145   PPCBE = 0x45,
146   SH3 = 0x50,
147   SH3E = 0x51,
148   SH3DSP = 0x52,
149   SH4 = 0x53,
150   SHMedia = 0x54,
151   ARM3 = 0x60,
152   ARM4 = 0x61,
153   ARM4T = 0x62,
154   ARM5 = 0x63,
155   ARM5T = 0x64,
156   ARM6 = 0x65,
157   ARM_XMAC = 0x66,
158   ARM_WMMX = 0x67,
159   ARM7 = 0x68,
160   Omni = 0x70,
161   Ia64 = 0x80,
162   Ia64_2 = 0x81,
163   CEE = 0x90,
164   AM33 = 0xa0,
165   M32R = 0xb0,
166   TriCore = 0xc0,
167   X64 = 0xd0,
168   EBC = 0xe0,
169   Thumb = 0xf0,
170   ARMNT = 0xf4,
171   D3D11_Shader = 0x100,
172 };
173
174 enum class PDB_Machine {
175   Invalid = 0xffff,
176   Unknown = 0x0,
177   Am33 = 0x13,
178   Amd64 = 0x8664,
179   Arm = 0x1C0,
180   Armnt = 0x1C4,
181   Ebc = 0xEBC,
182   I386 = 0x14C,
183   Ia64 = 0x200,
184   M32r = 0x9041,
185   Mips16 = 0x266,
186   MipsFPU = 0x366,
187   MipsFPU16 = 0x466,
188   PowerPC = 0x1F0,
189   PowerPCFP = 0x1F1,
190   R4000 = 0x166,
191   SH3 = 0x1A2,
192   SH3DSP = 0x1A3,
193   SH4 = 0x1A6,
194   SH5 = 0x1A8,
195   Thumb = 0x1C2,
196   WceMipsV2 = 0x169
197 };
198
199 /// These values correspond to the CV_call_e enumeration, and are documented
200 /// at the following locations:
201 ///   https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
202 ///   https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx
203 ///
204 enum class PDB_CallingConv {
205   NearCdecl = 0x00,
206   FarCdecl = 0x01,
207   NearPascal = 0x02,
208   FarPascal = 0x03,
209   NearFastcall = 0x04,
210   FarFastcall = 0x05,
211   Skipped = 0x06,
212   NearStdcall = 0x07,
213   FarStdcall = 0x08,
214   NearSyscall = 0x09,
215   FarSyscall = 0x0a,
216   Thiscall = 0x0b,
217   MipsCall = 0x0c,
218   Generic = 0x0d,
219   Alphacall = 0x0e,
220   Ppccall = 0x0f,
221   SuperHCall = 0x10,
222   Armcall = 0x11,
223   AM33call = 0x12,
224   Tricall = 0x13,
225   Sh5call = 0x14,
226   M32R = 0x15,
227   Clrcall = 0x16,
228   Inline = 0x17,
229   NearVectorcall = 0x18,
230   Reserved = 0x19,
231 };
232
233 /// These values correspond to the CV_CFL_LANG enumeration, and are documented
234 /// here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx
235 enum class PDB_Lang {
236   C = 0x00,
237   Cpp = 0x01,
238   Fortran = 0x02,
239   Masm = 0x03,
240   Pascal = 0x04,
241   Basic = 0x05,
242   Cobol = 0x06,
243   Link = 0x07,
244   Cvtres = 0x08,
245   Cvtpgd = 0x09,
246   CSharp = 0x0a,
247   VB = 0x0b,
248   ILAsm = 0x0c,
249   Java = 0x0d,
250   JScript = 0x0e,
251   MSIL = 0x0f,
252   HLSL = 0x10
253 };
254
255 /// These values correspond to the DataKind enumeration, and are documented
256 /// here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx
257 enum class PDB_DataKind {
258   Unknown,
259   Local,
260   StaticLocal,
261   Param,
262   ObjectPtr,
263   FileStatic,
264   Global,
265   Member,
266   StaticMember,
267   Constant
268 };
269
270 /// These values correspond to the SymTagEnum enumeration, and are documented
271 /// here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx
272 enum class PDB_SymType {
273   None,
274   Exe,
275   Compiland,
276   CompilandDetails,
277   CompilandEnv,
278   Function,
279   Block,
280   Data,
281   Annotation,
282   Label,
283   PublicSymbol,
284   UDT,
285   Enum,
286   FunctionSig,
287   PointerType,
288   ArrayType,
289   BuiltinType,
290   Typedef,
291   BaseClass,
292   Friend,
293   FunctionArg,
294   FuncDebugStart,
295   FuncDebugEnd,
296   UsingNamespace,
297   VTableShape,
298   VTable,
299   Custom,
300   Thunk,
301   CustomType,
302   ManagedType,
303   Dimension,
304   Max
305 };
306
307 /// These values correspond to the LocationType enumeration, and are documented
308 /// here: https://msdn.microsoft.com/en-us/library/f57kaez3.aspx
309 enum class PDB_LocType {
310   Null,
311   Static,
312   TLS,
313   RegRel,
314   ThisRel,
315   Enregistered,
316   BitField,
317   Slot,
318   IlRel,
319   MetaData,
320   Constant,
321   Max
322 };
323
324 /// These values correspond to the THUNK_ORDINAL enumeration, and are documented
325 /// here: https://msdn.microsoft.com/en-us/library/dh0k8hft.aspx
326 enum class PDB_ThunkOrdinal {
327   Standard,
328   ThisAdjustor,
329   Vcall,
330   Pcode,
331   UnknownLoad,
332   TrampIncremental,
333   BranchIsland
334 };
335
336 /// These values correspond to the UdtKind enumeration, and are documented
337 /// here: https://msdn.microsoft.com/en-us/library/wcstk66t.aspx
338 enum class PDB_UdtType { Struct, Class, Union, Interface };
339
340 /// These values correspond to the StackFrameTypeEnum enumeration, and are
341 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
342 enum class PDB_StackFrameType { FPO, KernelTrap, KernelTSS, EBP, FrameData };
343
344 /// These values correspond to the StackFrameTypeEnum enumeration, and are
345 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
346 enum class PDB_MemoryType { Code, Data, Stack, HeapCode };
347
348 /// These values correspond to the Basictype enumeration, and are documented
349 /// here: https://msdn.microsoft.com/en-us/library/4szdtzc3.aspx
350 enum class PDB_BuiltinType {
351   None = 0,
352   Void = 1,
353   Char = 2,
354   WCharT = 3,
355   Int = 6,
356   UInt = 7,
357   Float = 8,
358   BCD = 9,
359   Bool = 10,
360   Long = 13,
361   ULong = 14,
362   Currency = 25,
363   Date = 26,
364   Variant = 27,
365   Complex = 28,
366   Bitfield = 29,
367   BSTR = 30,
368   HResult = 31
369 };
370
371 enum class PDB_MemberAccess { Private = 1, Protected = 2, Public = 3 };
372
373 struct VersionInfo {
374   uint32_t Major;
375   uint32_t Minor;
376   uint32_t Build;
377   uint32_t QFE;
378 };
379
380 } // namespace llvm
381
382 #endif