1//===- llvm/Support/Dwarf.def - Dwarf definitions ---------------*- 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// Macros for running through Dwarf enumerators.
11//
12//===----------------------------------------------------------------------===//
13
14// TODO: Add other DW-based macros.
15#if !(defined HANDLE_DW_TAG || defined HANDLE_DW_OP ||                         \
16      defined HANDLE_DW_LANG || defined HANDLE_DW_ATE ||                       \
17      defined HANDLE_DW_VIRTUALITY)
18#error "Missing macro definition of HANDLE_DW*"
19#endif
20
21#ifndef HANDLE_DW_TAG
22#define HANDLE_DW_TAG(ID, NAME)
23#endif
24
25#ifndef HANDLE_DW_OP
26#define HANDLE_DW_OP(ID, NAME)
27#endif
28
29#ifndef HANDLE_DW_LANG
30#define HANDLE_DW_LANG(ID, NAME)
31#endif
32
33#ifndef HANDLE_DW_ATE
34#define HANDLE_DW_ATE(ID, NAME)
35#endif
36
37#ifndef HANDLE_DW_VIRTUALITY
38#define HANDLE_DW_VIRTUALITY(ID, NAME)
39#endif
40
41HANDLE_DW_TAG(0x0001, array_type)
42HANDLE_DW_TAG(0x0002, class_type)
43HANDLE_DW_TAG(0x0003, entry_point)
44HANDLE_DW_TAG(0x0004, enumeration_type)
45HANDLE_DW_TAG(0x0005, formal_parameter)
46HANDLE_DW_TAG(0x0008, imported_declaration)
47HANDLE_DW_TAG(0x000a, label)
48HANDLE_DW_TAG(0x000b, lexical_block)
49HANDLE_DW_TAG(0x000d, member)
50HANDLE_DW_TAG(0x000f, pointer_type)
51HANDLE_DW_TAG(0x0010, reference_type)
52HANDLE_DW_TAG(0x0011, compile_unit)
53HANDLE_DW_TAG(0x0012, string_type)
54HANDLE_DW_TAG(0x0013, structure_type)
55HANDLE_DW_TAG(0x0015, subroutine_type)
56HANDLE_DW_TAG(0x0016, typedef)
57HANDLE_DW_TAG(0x0017, union_type)
58HANDLE_DW_TAG(0x0018, unspecified_parameters)
59HANDLE_DW_TAG(0x0019, variant)
60HANDLE_DW_TAG(0x001a, common_block)
61HANDLE_DW_TAG(0x001b, common_inclusion)
62HANDLE_DW_TAG(0x001c, inheritance)
63HANDLE_DW_TAG(0x001d, inlined_subroutine)
64HANDLE_DW_TAG(0x001e, module)
65HANDLE_DW_TAG(0x001f, ptr_to_member_type)
66HANDLE_DW_TAG(0x0020, set_type)
67HANDLE_DW_TAG(0x0021, subrange_type)
68HANDLE_DW_TAG(0x0022, with_stmt)
69HANDLE_DW_TAG(0x0023, access_declaration)
70HANDLE_DW_TAG(0x0024, base_type)
71HANDLE_DW_TAG(0x0025, catch_block)
72HANDLE_DW_TAG(0x0026, const_type)
73HANDLE_DW_TAG(0x0027, constant)
74HANDLE_DW_TAG(0x0028, enumerator)
75HANDLE_DW_TAG(0x0029, file_type)
76HANDLE_DW_TAG(0x002a, friend)
77HANDLE_DW_TAG(0x002b, namelist)
78HANDLE_DW_TAG(0x002c, namelist_item)
79HANDLE_DW_TAG(0x002d, packed_type)
80HANDLE_DW_TAG(0x002e, subprogram)
81HANDLE_DW_TAG(0x002f, template_type_parameter)
82HANDLE_DW_TAG(0x0030, template_value_parameter)
83HANDLE_DW_TAG(0x0031, thrown_type)
84HANDLE_DW_TAG(0x0032, try_block)
85HANDLE_DW_TAG(0x0033, variant_part)
86HANDLE_DW_TAG(0x0034, variable)
87HANDLE_DW_TAG(0x0035, volatile_type)
88HANDLE_DW_TAG(0x0036, dwarf_procedure)
89HANDLE_DW_TAG(0x0037, restrict_type)
90HANDLE_DW_TAG(0x0038, interface_type)
91HANDLE_DW_TAG(0x0039, namespace)
92HANDLE_DW_TAG(0x003a, imported_module)
93HANDLE_DW_TAG(0x003b, unspecified_type)
94HANDLE_DW_TAG(0x003c, partial_unit)
95HANDLE_DW_TAG(0x003d, imported_unit)
96HANDLE_DW_TAG(0x003f, condition)
97HANDLE_DW_TAG(0x0040, shared_type)
98HANDLE_DW_TAG(0x0041, type_unit)
99HANDLE_DW_TAG(0x0042, rvalue_reference_type)
100HANDLE_DW_TAG(0x0043, template_alias)
101
102// Mock tags we use as discriminators.
103HANDLE_DW_TAG(0x0100, auto_variable) // Tag for local (auto) variables.
104HANDLE_DW_TAG(0x0101, arg_variable)  // Tag for argument variables.
105
106// New in DWARF v5.
107HANDLE_DW_TAG(0x0044, coarray_type)
108HANDLE_DW_TAG(0x0045, generic_subrange)
109HANDLE_DW_TAG(0x0046, dynamic_type)
110
111// User-defined tags.
112HANDLE_DW_TAG(0x4081, MIPS_loop)
113HANDLE_DW_TAG(0x4101, format_label)
114HANDLE_DW_TAG(0x4102, function_template)
115HANDLE_DW_TAG(0x4103, class_template)
116HANDLE_DW_TAG(0x4106, GNU_template_template_param)
117HANDLE_DW_TAG(0x4107, GNU_template_parameter_pack)
118HANDLE_DW_TAG(0x4108, GNU_formal_parameter_pack)
119HANDLE_DW_TAG(0x4200, APPLE_property)
120
121HANDLE_DW_OP(0x03, addr)
122HANDLE_DW_OP(0x06, deref)
123HANDLE_DW_OP(0x08, const1u)
124HANDLE_DW_OP(0x09, const1s)
125HANDLE_DW_OP(0x0a, const2u)
126HANDLE_DW_OP(0x0b, const2s)
127HANDLE_DW_OP(0x0c, const4u)
128HANDLE_DW_OP(0x0d, const4s)
129HANDLE_DW_OP(0x0e, const8u)
130HANDLE_DW_OP(0x0f, const8s)
131HANDLE_DW_OP(0x10, constu)
132HANDLE_DW_OP(0x11, consts)
133HANDLE_DW_OP(0x12, dup)
134HANDLE_DW_OP(0x13, drop)
135HANDLE_DW_OP(0x14, over)
136HANDLE_DW_OP(0x15, pick)
137HANDLE_DW_OP(0x16, swap)
138HANDLE_DW_OP(0x17, rot)
139HANDLE_DW_OP(0x18, xderef)
140HANDLE_DW_OP(0x19, abs)
141HANDLE_DW_OP(0x1a, and)
142HANDLE_DW_OP(0x1b, div)
143HANDLE_DW_OP(0x1c, minus)
144HANDLE_DW_OP(0x1d, mod)
145HANDLE_DW_OP(0x1e, mul)
146HANDLE_DW_OP(0x1f, neg)
147HANDLE_DW_OP(0x20, not)
148HANDLE_DW_OP(0x21, or )
149HANDLE_DW_OP(0x22, plus)
150HANDLE_DW_OP(0x23, plus_uconst)
151HANDLE_DW_OP(0x24, shl)
152HANDLE_DW_OP(0x25, shr)
153HANDLE_DW_OP(0x26, shra)
154HANDLE_DW_OP(0x27, xor)
155HANDLE_DW_OP(0x2f, skip)
156HANDLE_DW_OP(0x28, bra)
157HANDLE_DW_OP(0x29, eq)
158HANDLE_DW_OP(0x2a, ge)
159HANDLE_DW_OP(0x2b, gt)
160HANDLE_DW_OP(0x2c, le)
161HANDLE_DW_OP(0x2d, lt)
162HANDLE_DW_OP(0x2e, ne)
163HANDLE_DW_OP(0x30, lit0)
164HANDLE_DW_OP(0x31, lit1)
165HANDLE_DW_OP(0x32, lit2)
166HANDLE_DW_OP(0x33, lit3)
167HANDLE_DW_OP(0x34, lit4)
168HANDLE_DW_OP(0x35, lit5)
169HANDLE_DW_OP(0x36, lit6)
170HANDLE_DW_OP(0x37, lit7)
171HANDLE_DW_OP(0x38, lit8)
172HANDLE_DW_OP(0x39, lit9)
173HANDLE_DW_OP(0x3a, lit10)
174HANDLE_DW_OP(0x3b, lit11)
175HANDLE_DW_OP(0x3c, lit12)
176HANDLE_DW_OP(0x3d, lit13)
177HANDLE_DW_OP(0x3e, lit14)
178HANDLE_DW_OP(0x3f, lit15)
179HANDLE_DW_OP(0x40, lit16)
180HANDLE_DW_OP(0x41, lit17)
181HANDLE_DW_OP(0x42, lit18)
182HANDLE_DW_OP(0x43, lit19)
183HANDLE_DW_OP(0x44, lit20)
184HANDLE_DW_OP(0x45, lit21)
185HANDLE_DW_OP(0x46, lit22)
186HANDLE_DW_OP(0x47, lit23)
187HANDLE_DW_OP(0x48, lit24)
188HANDLE_DW_OP(0x49, lit25)
189HANDLE_DW_OP(0x4a, lit26)
190HANDLE_DW_OP(0x4b, lit27)
191HANDLE_DW_OP(0x4c, lit28)
192HANDLE_DW_OP(0x4d, lit29)
193HANDLE_DW_OP(0x4e, lit30)
194HANDLE_DW_OP(0x4f, lit31)
195HANDLE_DW_OP(0x50, reg0)
196HANDLE_DW_OP(0x51, reg1)
197HANDLE_DW_OP(0x52, reg2)
198HANDLE_DW_OP(0x53, reg3)
199HANDLE_DW_OP(0x54, reg4)
200HANDLE_DW_OP(0x55, reg5)
201HANDLE_DW_OP(0x56, reg6)
202HANDLE_DW_OP(0x57, reg7)
203HANDLE_DW_OP(0x58, reg8)
204HANDLE_DW_OP(0x59, reg9)
205HANDLE_DW_OP(0x5a, reg10)
206HANDLE_DW_OP(0x5b, reg11)
207HANDLE_DW_OP(0x5c, reg12)
208HANDLE_DW_OP(0x5d, reg13)
209HANDLE_DW_OP(0x5e, reg14)
210HANDLE_DW_OP(0x5f, reg15)
211HANDLE_DW_OP(0x60, reg16)
212HANDLE_DW_OP(0x61, reg17)
213HANDLE_DW_OP(0x62, reg18)
214HANDLE_DW_OP(0x63, reg19)
215HANDLE_DW_OP(0x64, reg20)
216HANDLE_DW_OP(0x65, reg21)
217HANDLE_DW_OP(0x66, reg22)
218HANDLE_DW_OP(0x67, reg23)
219HANDLE_DW_OP(0x68, reg24)
220HANDLE_DW_OP(0x69, reg25)
221HANDLE_DW_OP(0x6a, reg26)
222HANDLE_DW_OP(0x6b, reg27)
223HANDLE_DW_OP(0x6c, reg28)
224HANDLE_DW_OP(0x6d, reg29)
225HANDLE_DW_OP(0x6e, reg30)
226HANDLE_DW_OP(0x6f, reg31)
227HANDLE_DW_OP(0x70, breg0)
228HANDLE_DW_OP(0x71, breg1)
229HANDLE_DW_OP(0x72, breg2)
230HANDLE_DW_OP(0x73, breg3)
231HANDLE_DW_OP(0x74, breg4)
232HANDLE_DW_OP(0x75, breg5)
233HANDLE_DW_OP(0x76, breg6)
234HANDLE_DW_OP(0x77, breg7)
235HANDLE_DW_OP(0x78, breg8)
236HANDLE_DW_OP(0x79, breg9)
237HANDLE_DW_OP(0x7a, breg10)
238HANDLE_DW_OP(0x7b, breg11)
239HANDLE_DW_OP(0x7c, breg12)
240HANDLE_DW_OP(0x7d, breg13)
241HANDLE_DW_OP(0x7e, breg14)
242HANDLE_DW_OP(0x7f, breg15)
243HANDLE_DW_OP(0x80, breg16)
244HANDLE_DW_OP(0x81, breg17)
245HANDLE_DW_OP(0x82, breg18)
246HANDLE_DW_OP(0x83, breg19)
247HANDLE_DW_OP(0x84, breg20)
248HANDLE_DW_OP(0x85, breg21)
249HANDLE_DW_OP(0x86, breg22)
250HANDLE_DW_OP(0x87, breg23)
251HANDLE_DW_OP(0x88, breg24)
252HANDLE_DW_OP(0x89, breg25)
253HANDLE_DW_OP(0x8a, breg26)
254HANDLE_DW_OP(0x8b, breg27)
255HANDLE_DW_OP(0x8c, breg28)
256HANDLE_DW_OP(0x8d, breg29)
257HANDLE_DW_OP(0x8e, breg30)
258HANDLE_DW_OP(0x8f, breg31)
259HANDLE_DW_OP(0x90, regx)
260HANDLE_DW_OP(0x91, fbreg)
261HANDLE_DW_OP(0x92, bregx)
262HANDLE_DW_OP(0x93, piece)
263HANDLE_DW_OP(0x94, deref_size)
264HANDLE_DW_OP(0x95, xderef_size)
265HANDLE_DW_OP(0x96, nop)
266HANDLE_DW_OP(0x97, push_object_address)
267HANDLE_DW_OP(0x98, call2)
268HANDLE_DW_OP(0x99, call4)
269HANDLE_DW_OP(0x9a, call_ref)
270HANDLE_DW_OP(0x9b, form_tls_address)
271HANDLE_DW_OP(0x9c, call_frame_cfa)
272HANDLE_DW_OP(0x9d, bit_piece)
273HANDLE_DW_OP(0x9e, implicit_value)
274HANDLE_DW_OP(0x9f, stack_value)
275
276// Extensions for GNU-style thread-local storage.
277HANDLE_DW_OP(0xe0, GNU_push_tls_address)
278
279// Extensions for Fission proposal.
280HANDLE_DW_OP(0xfb, GNU_addr_index)
281HANDLE_DW_OP(0xfc, GNU_const_index)
282
283// DWARF languages.
284HANDLE_DW_LANG(0x0001, C89)
285HANDLE_DW_LANG(0x0002, C)
286HANDLE_DW_LANG(0x0003, Ada83)
287HANDLE_DW_LANG(0x0004, C_plus_plus)
288HANDLE_DW_LANG(0x0005, Cobol74)
289HANDLE_DW_LANG(0x0006, Cobol85)
290HANDLE_DW_LANG(0x0007, Fortran77)
291HANDLE_DW_LANG(0x0008, Fortran90)
292HANDLE_DW_LANG(0x0009, Pascal83)
293HANDLE_DW_LANG(0x000a, Modula2)
294HANDLE_DW_LANG(0x000b, Java)
295HANDLE_DW_LANG(0x000c, C99)
296HANDLE_DW_LANG(0x000d, Ada95)
297HANDLE_DW_LANG(0x000e, Fortran95)
298HANDLE_DW_LANG(0x000f, PLI)
299HANDLE_DW_LANG(0x0010, ObjC)
300HANDLE_DW_LANG(0x0011, ObjC_plus_plus)
301HANDLE_DW_LANG(0x0012, UPC)
302HANDLE_DW_LANG(0x0013, D)
303
304// New in DWARF 5:
305HANDLE_DW_LANG(0x0014, Python)
306HANDLE_DW_LANG(0x0015, OpenCL)
307HANDLE_DW_LANG(0x0016, Go)
308HANDLE_DW_LANG(0x0017, Modula3)
309HANDLE_DW_LANG(0x0018, Haskell)
310HANDLE_DW_LANG(0x0019, C_plus_plus_03)
311HANDLE_DW_LANG(0x001a, C_plus_plus_11)
312HANDLE_DW_LANG(0x001b, OCaml)
313HANDLE_DW_LANG(0x001c, Rust)
314HANDLE_DW_LANG(0x001d, C11)
315HANDLE_DW_LANG(0x001e, Swift)
316HANDLE_DW_LANG(0x001f, Julia)
317HANDLE_DW_LANG(0x0020, Dylan)
318HANDLE_DW_LANG(0x0021, C_plus_plus_14)
319HANDLE_DW_LANG(0x0022, Fortran03)
320HANDLE_DW_LANG(0x0023, Fortran08)
321HANDLE_DW_LANG(0x8001, Mips_Assembler)
322
323// DWARF attribute type encodings.
324HANDLE_DW_ATE(0x01, address)
325HANDLE_DW_ATE(0x02, boolean)
326HANDLE_DW_ATE(0x03, complex_float)
327HANDLE_DW_ATE(0x04, float)
328HANDLE_DW_ATE(0x05, signed)
329HANDLE_DW_ATE(0x06, signed_char)
330HANDLE_DW_ATE(0x07, unsigned)
331HANDLE_DW_ATE(0x08, unsigned_char)
332HANDLE_DW_ATE(0x09, imaginary_float)
333HANDLE_DW_ATE(0x0a, packed_decimal)
334HANDLE_DW_ATE(0x0b, numeric_string)
335HANDLE_DW_ATE(0x0c, edited)
336HANDLE_DW_ATE(0x0d, signed_fixed)
337HANDLE_DW_ATE(0x0e, unsigned_fixed)
338HANDLE_DW_ATE(0x0f, decimal_float)
339HANDLE_DW_ATE(0x10, UTF)
340
341// DWARF virtuality codes.
342HANDLE_DW_VIRTUALITY(0x00, none)
343HANDLE_DW_VIRTUALITY(0x01, virtual)
344HANDLE_DW_VIRTUALITY(0x02, pure_virtual)
345
346#undef HANDLE_DW_TAG
347#undef HANDLE_DW_OP
348#undef HANDLE_DW_LANG
349#undef HANDLE_DW_ATE
350#undef HANDLE_DW_VIRTUALITY
351