]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
MFV r302260: expat 2.2.0
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / CodeView / CodeView.h
1 //===- CodeView.h -----------------------------------------------*- C++ -*-===//
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_CODEVIEW_CODEVIEW_H
11 #define LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
12
13 #include <cinttypes>
14
15 namespace llvm {
16 namespace codeview {
17
18 enum class CallingConvention : uint8_t {
19   NearC = 0x00,       // near right to left push, caller pops stack
20   FarC = 0x01,        // far right to left push, caller pops stack
21   NearPascal = 0x02,  // near left to right push, callee pops stack
22   FarPascal = 0x03,   // far left to right push, callee pops stack
23   NearFast = 0x04,    // near left to right push with regs, callee pops stack
24   FarFast = 0x05,     // far left to right push with regs, callee pops stack
25   NearStdCall = 0x07, // near standard call
26   FarStdCall = 0x08,  // far standard call
27   NearSysCall = 0x09, // near sys call
28   FarSysCall = 0x0a,  // far sys call
29   ThisCall = 0x0b,    // this call (this passed in register)
30   MipsCall = 0x0c,    // Mips call
31   Generic = 0x0d,     // Generic call sequence
32   AlphaCall = 0x0e,   // Alpha call
33   PpcCall = 0x0f,     // PPC call
34   SHCall = 0x10,      // Hitachi SuperH call
35   ArmCall = 0x11,     // ARM call
36   AM33Call = 0x12,    // AM33 call
37   TriCall = 0x13,     // TriCore Call
38   SH5Call = 0x14,     // Hitachi SuperH-5 call
39   M32RCall = 0x15,    // M32R Call
40   ClrCall = 0x16,     // clr call
41   Inline =
42       0x17, // Marker for routines always inlined and thus lacking a convention
43   NearVector = 0x18 // near left to right push with regs, callee pops stack
44 };
45
46 enum class ClassOptions : uint16_t {
47   None = 0x0000,
48   Packed = 0x0001,
49   HasConstructorOrDestructor = 0x0002,
50   HasOverloadedOperator = 0x0004,
51   Nested = 0x0008,
52   ContainsNestedClass = 0x0010,
53   HasOverloadedAssignmentOperator = 0x0020,
54   HasConversionOperator = 0x0040,
55   ForwardReference = 0x0080,
56   Scoped = 0x0100,
57   HasUniqueName = 0x0200,
58   Sealed = 0x0400,
59   Intrinsic = 0x2000
60 };
61
62 inline ClassOptions operator|(ClassOptions a, ClassOptions b) {
63   return static_cast<ClassOptions>(static_cast<uint16_t>(a) |
64                                    static_cast<uint16_t>(b));
65 }
66
67 inline ClassOptions operator&(ClassOptions a, ClassOptions b) {
68   return static_cast<ClassOptions>(static_cast<uint16_t>(a) &
69                                    static_cast<uint16_t>(b));
70 }
71
72 inline ClassOptions operator~(ClassOptions a) {
73   return static_cast<ClassOptions>(~static_cast<uint16_t>(a));
74 }
75
76 enum class FrameProcedureOptions : uint32_t {
77   None = 0x00000000,
78   HasAlloca = 0x00000001,
79   HasSetJmp = 0x00000002,
80   HasLongJmp = 0x00000004,
81   HasInlineAssembly = 0x00000008,
82   HasExceptionHandling = 0x00000010,
83   MarkedInline = 0x00000020,
84   HasStructuredExceptionHandling = 0x00000040,
85   Naked = 0x00000080,
86   SecurityChecks = 0x00000100,
87   AsynchronousExceptionHandling = 0x00000200,
88   NoStackOrderingForSecurityChecks = 0x00000400,
89   Inlined = 0x00000800,
90   StrictSecurityChecks = 0x00001000,
91   SafeBuffers = 0x00002000,
92   ProfileGuidedOptimization = 0x00040000,
93   ValidProfileCounts = 0x00080000,
94   OptimizedForSpeed = 0x00100000,
95   GuardCfg = 0x00200000,
96   GuardCfw = 0x00400000
97 };
98
99 inline FrameProcedureOptions operator|(FrameProcedureOptions a,
100                                        FrameProcedureOptions b) {
101   return static_cast<FrameProcedureOptions>(static_cast<uint32_t>(a) |
102                                             static_cast<uint32_t>(b));
103 }
104
105 inline FrameProcedureOptions operator&(FrameProcedureOptions a,
106                                        FrameProcedureOptions b) {
107   return static_cast<FrameProcedureOptions>(static_cast<uint32_t>(a) &
108                                             static_cast<uint32_t>(b));
109 }
110
111 inline FrameProcedureOptions operator~(FrameProcedureOptions a) {
112   return static_cast<FrameProcedureOptions>(~static_cast<uint32_t>(a));
113 }
114
115 enum class FunctionOptions : uint8_t {
116   None = 0x00,
117   CxxReturnUdt = 0x01,
118   Constructor = 0x02,
119   ConstructorWithVirtualBases = 0x04
120 };
121
122 inline FunctionOptions operator|(FunctionOptions a, FunctionOptions b) {
123   return static_cast<FunctionOptions>(static_cast<uint8_t>(a) |
124                                       static_cast<uint8_t>(b));
125 }
126
127 inline FunctionOptions operator&(FunctionOptions a, FunctionOptions b) {
128   return static_cast<FunctionOptions>(static_cast<uint8_t>(a) &
129                                       static_cast<uint8_t>(b));
130 }
131
132 inline FunctionOptions operator~(FunctionOptions a) {
133   return static_cast<FunctionOptions>(~static_cast<uint8_t>(a));
134 }
135
136 enum class HfaKind : uint8_t {
137   None = 0x00,
138   Float = 0x01,
139   Double = 0x02,
140   Other = 0x03
141 };
142
143 enum class MemberAccess : uint8_t {
144   None = 0,
145   Private = 1,
146   Protected = 2,
147   Public = 3
148 };
149
150 enum class MethodKind : uint8_t {
151   Vanilla = 0x00,
152   Virtual = 0x01,
153   Static = 0x02,
154   Friend = 0x03,
155   IntroducingVirtual = 0x04,
156   PureVirtual = 0x05,
157   PureIntroducingVirtual = 0x06
158 };
159
160 enum class MethodOptions : uint16_t {
161   None = 0x0000,
162   Pseudo = 0x0020,
163   CompilerGenerated = 0x0100,
164   Sealed = 0x0200
165 };
166
167 inline MethodOptions operator|(MethodOptions a, MethodOptions b) {
168   return static_cast<MethodOptions>(static_cast<uint16_t>(a) |
169                                     static_cast<uint16_t>(b));
170 }
171
172 inline MethodOptions operator&(MethodOptions a, MethodOptions b) {
173   return static_cast<MethodOptions>(static_cast<uint16_t>(a) &
174                                     static_cast<uint16_t>(b));
175 }
176
177 inline MethodOptions operator~(MethodOptions a) {
178   return static_cast<MethodOptions>(~static_cast<uint16_t>(a));
179 }
180
181 enum class ModifierOptions : uint16_t {
182   None = 0x0000,
183   Const = 0x0001,
184   Volatile = 0x0002,
185   Unaligned = 0x0004
186 };
187
188 inline ModifierOptions operator|(ModifierOptions a, ModifierOptions b) {
189   return static_cast<ModifierOptions>(static_cast<uint16_t>(a) |
190                                       static_cast<uint16_t>(b));
191 }
192
193 inline ModifierOptions operator&(ModifierOptions a, ModifierOptions b) {
194   return static_cast<ModifierOptions>(static_cast<uint16_t>(a) &
195                                       static_cast<uint16_t>(b));
196 }
197
198 inline ModifierOptions operator~(ModifierOptions a) {
199   return static_cast<ModifierOptions>(~static_cast<uint16_t>(a));
200 }
201
202 enum class ModuleSubstreamKind : uint32_t {
203   Symbols = 0xf1,
204   Lines = 0xf2,
205   StringTable = 0xf3,
206   FileChecksums = 0xf4,
207   FrameData = 0xf5,
208   InlineeLines = 0xf6,
209   CrossScopeImports = 0xf7,
210   CrossScopeExports = 0xf8
211 };
212
213 enum class PointerKind : uint8_t {
214   Near16 = 0x00,                // 16 bit pointer
215   Far16 = 0x01,                 // 16:16 far pointer
216   Huge16 = 0x02,                // 16:16 huge pointer
217   BasedOnSegment = 0x03,        // based on segment
218   BasedOnValue = 0x04,          // based on value of base
219   BasedOnSegmentValue = 0x05,   // based on segment value of base
220   BasedOnAddress = 0x06,        // based on address of base
221   BasedOnSegmentAddress = 0x07, // based on segment address of base
222   BasedOnType = 0x08,           // based on type
223   BasedOnSelf = 0x09,           // based on self
224   Near32 = 0x0a,                // 32 bit pointer
225   Far32 = 0x0b,                 // 16:32 pointer
226   Near64 = 0x0c                 // 64 bit pointer
227 };
228
229 enum class PointerMode : uint8_t {
230   Pointer = 0x00,                 // "normal" pointer
231   LValueReference = 0x01,         // "old" reference
232   PointerToDataMember = 0x02,     // pointer to data member
233   PointerToMemberFunction = 0x03, // pointer to member function
234   RValueReference = 0x04          // r-value reference
235 };
236
237 enum class PointerOptions : uint32_t {
238   None = 0x00000000,
239   Flat32 = 0x00000100,
240   Volatile = 0x00000200,
241   Const = 0x00000400,
242   Unaligned = 0x00000800,
243   Restrict = 0x00001000,
244   WinRTSmartPointer = 0x00080000
245 };
246
247 inline PointerOptions operator|(PointerOptions a, PointerOptions b) {
248   return static_cast<PointerOptions>(static_cast<uint16_t>(a) |
249                                      static_cast<uint16_t>(b));
250 }
251
252 inline PointerOptions operator&(PointerOptions a, PointerOptions b) {
253   return static_cast<PointerOptions>(static_cast<uint16_t>(a) &
254                                      static_cast<uint16_t>(b));
255 }
256
257 inline PointerOptions operator~(PointerOptions a) {
258   return static_cast<PointerOptions>(~static_cast<uint16_t>(a));
259 }
260
261 enum class PointerToMemberRepresentation : uint16_t {
262   Unknown = 0x00,                     // not specified (pre VC8)
263   SingleInheritanceData = 0x01,       // member data, single inheritance
264   MultipleInheritanceData = 0x02,     // member data, multiple inheritance
265   VirtualInheritanceData = 0x03,      // member data, virtual inheritance
266   GeneralData = 0x04,                 // member data, most general
267   SingleInheritanceFunction = 0x05,   // member function, single inheritance
268   MultipleInheritanceFunction = 0x06, // member function, multiple inheritance
269   VirtualInheritanceFunction = 0x07,  // member function, virtual inheritance
270   GeneralFunction = 0x08              // member function, most general
271 };
272
273 enum class TypeRecordKind : uint16_t {
274   None = 0,
275
276   VirtualTableShape = 0x000a,
277   Label = 0x000e,
278   EndPrecompiledHeader = 0x0014,
279
280   Modifier = 0x1001,
281   Pointer = 0x1002,
282   Procedure = 0x1008,
283   MemberFunction = 0x1009,
284
285   Oem = 0x100f,
286   Oem2 = 0x1011,
287
288   ArgumentList = 0x1201,
289   FieldList = 0x1203,
290   BitField = 0x1205,
291   MethodList = 0x1206,
292
293   BaseClass = 0x1400,
294   VirtualBaseClass = 0x1401,
295   IndirectVirtualBaseClass = 0x1402,
296   Index = 0x1404,
297   VirtualFunctionTablePointer = 0x1409,
298
299   Enumerate = 0x1502,
300   Array = 0x1503,
301   Class = 0x1504,
302   Structure = 0x1505,
303   Union = 0x1506,
304   Enum = 0x1507,
305   Alias = 0x150a,
306   Member = 0x150d,
307   StaticMember = 0x150e,
308   Method = 0x150f,
309   NestedType = 0x1510,
310   OneMethod = 0x1511,
311   VirtualFunctionTable = 0x151d,
312
313   FunctionId = 0x1601,
314   MemberFunctionId = 0x1602,
315   BuildInfo = 0x1603,
316   SubstringList = 0x1604,
317   StringId = 0x1605,
318   UdtSourceLine = 0x1606,
319
320   SByte = 0x8000,
321   Int16 = 0x8001,
322   UInt16 = 0x8002,
323   Int32 = 0x8003,
324   UInt32 = 0x8004,
325   Single = 0x8005,
326   Double = 0x8006,
327   Float80 = 0x8007,
328   Float128 = 0x8008,
329   Int64 = 0x8009,
330   UInt64 = 0x800a,
331   Float48 = 0x800b,
332   Complex32 = 0x800c,
333   Complex64 = 0x800d,
334   Complex80 = 0x800e,
335   Complex128 = 0x800f,
336   VarString = 0x8010,
337
338   Int128 = 0x8017,
339   UInt128 = 0x8018,
340
341   Decimal = 0x8019,
342   Date = 0x801a,
343   Utf8String = 0x801b,
344
345   Float16 = 0x801c
346 };
347
348 enum class VirtualTableSlotKind : uint8_t {
349   Near16 = 0x00,
350   Far16 = 0x01,
351   This = 0x02,
352   Outer = 0x03,
353   Meta = 0x04,
354   Near = 0x05,
355   Far = 0x06
356 };
357
358 enum class WindowsRTClassKind : uint8_t {
359   None = 0x00,
360   RefClass = 0x01,
361   ValueClass = 0x02,
362   Interface = 0x03
363 };
364 }
365 }
366
367 #endif