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