d9ed672c73a16a41f37290a0cdd6af7e96c7aa1a
[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<IPDBRawSymbol> 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 /// These values correspond to the CV_call_e enumeration, and are documented
175 /// at the following locations:
176 ///   https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
177 ///   https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx
178 ///
179 enum class PDB_CallingConv {
180   NearCdecl = 0x00,
181   FarCdecl = 0x01,
182   NearPascal = 0x02,
183   FarPascal = 0x03,
184   NearFastcall = 0x04,
185   FarFastcall = 0x05,
186   Skipped = 0x06,
187   NearStdcall = 0x07,
188   FarStdcall = 0x08,
189   NearSyscall = 0x09,
190   FarSyscall = 0x0a,
191   Thiscall = 0x0b,
192   MipsCall = 0x0c,
193   Generic = 0x0d,
194   Alphacall = 0x0e,
195   Ppccall = 0x0f,
196   SuperHCall = 0x10,
197   Armcall = 0x11,
198   AM33call = 0x12,
199   Tricall = 0x13,
200   Sh5call = 0x14,
201   M32R = 0x15,
202   Clrcall = 0x16,
203   Inline = 0x17,
204   NearVectorcall = 0x18,
205   Reserved = 0x19,
206 };
207
208 /// These values correspond to the CV_CFL_LANG enumeration, and are documented
209 /// here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx
210 enum class PDB_Lang {
211   C = 0x00,
212   Cpp = 0x01,
213   Fortran = 0x02,
214   Masm = 0x03,
215   Pascal = 0x04,
216   Basic = 0x05,
217   Cobol = 0x06,
218   Link = 0x07,
219   Cvtres = 0x08,
220   Cvtpgd = 0x09,
221   CSharp = 0x0a,
222   VB = 0x0b,
223   ILAsm = 0x0c,
224   Java = 0x0d,
225   JScript = 0x0e,
226   MSIL = 0x0f,
227   HLSL = 0x10
228 };
229
230 /// These values correspond to the DataKind enumeration, and are documented
231 /// here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx
232 enum class PDB_DataKind {
233   Unknown,
234   Local,
235   StaticLocal,
236   Param,
237   ObjectPtr,
238   FileStatic,
239   Global,
240   Member,
241   StaticMember,
242   Constant
243 };
244
245 /// These values correspond to the SymTagEnum enumeration, and are documented
246 /// here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx
247 enum class PDB_SymType {
248   None,
249   Exe,
250   Compiland,
251   CompilandDetails,
252   CompilandEnv,
253   Function,
254   Block,
255   Data,
256   Annotation,
257   Label,
258   PublicSymbol,
259   UDT,
260   Enum,
261   FunctionSig,
262   PointerType,
263   ArrayType,
264   BuiltinType,
265   Typedef,
266   BaseClass,
267   Friend,
268   FunctionArg,
269   FuncDebugStart,
270   FuncDebugEnd,
271   UsingNamespace,
272   VTableShape,
273   VTable,
274   Custom,
275   Thunk,
276   CustomType,
277   ManagedType,
278   Dimension,
279   Max
280 };
281
282 /// These values correspond to the LocationType enumeration, and are documented
283 /// here: https://msdn.microsoft.com/en-us/library/f57kaez3.aspx
284 enum class PDB_LocType {
285   Null,
286   Static,
287   TLS,
288   RegRel,
289   ThisRel,
290   Enregistered,
291   BitField,
292   Slot,
293   IlRel,
294   MetaData,
295   Constant,
296   Max
297 };
298
299 /// These values correspond to the THUNK_ORDINAL enumeration, and are documented
300 /// here: https://msdn.microsoft.com/en-us/library/dh0k8hft.aspx
301 enum class PDB_ThunkOrdinal {
302   Standard,
303   ThisAdjustor,
304   Vcall,
305   Pcode,
306   UnknownLoad,
307   TrampIncremental,
308   BranchIsland
309 };
310
311 /// These values correspond to the UdtKind enumeration, and are documented
312 /// here: https://msdn.microsoft.com/en-us/library/wcstk66t.aspx
313 enum class PDB_UdtType { Struct, Class, Union, Interface };
314
315 /// These values correspond to the StackFrameTypeEnum enumeration, and are
316 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
317 enum class PDB_StackFrameType { FPO, KernelTrap, KernelTSS, EBP, FrameData };
318
319 /// These values correspond to the StackFrameTypeEnum enumeration, and are
320 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
321 enum class PDB_MemoryType { Code, Data, Stack, HeapCode };
322
323 /// These values correspond to the Basictype enumeration, and are documented
324 /// here: https://msdn.microsoft.com/en-us/library/4szdtzc3.aspx
325 enum class PDB_BuiltinType {
326   None = 0,
327   Void = 1,
328   Char = 2,
329   WCharT = 3,
330   Int = 6,
331   UInt = 7,
332   Float = 8,
333   BCD = 9,
334   Bool = 10,
335   Long = 13,
336   ULong = 14,
337   Currency = 25,
338   Date = 26,
339   Variant = 27,
340   Complex = 28,
341   Bitfield = 29,
342   BSTR = 30,
343   HResult = 31
344 };
345
346 enum class PDB_MemberAccess { Private = 1, Protected = 2, Public = 3 };
347
348 } // namespace llvm
349
350 #endif