1f4a2713aSLionel Sambuc //===-- llvm/Support/Dwarf.h ---Dwarf Constants------------------*- C++ -*-===//
2f4a2713aSLionel Sambuc //
3f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4f4a2713aSLionel Sambuc //
5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7f4a2713aSLionel Sambuc //
8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9f4a2713aSLionel Sambuc //
10*0a6a1f1dSLionel Sambuc // \file
11*0a6a1f1dSLionel Sambuc // \brief This file contains constants used for implementing Dwarf
12*0a6a1f1dSLionel Sambuc // debug support.
13*0a6a1f1dSLionel Sambuc //
14*0a6a1f1dSLionel Sambuc // For details on the Dwarf specfication see the latest DWARF Debugging
15*0a6a1f1dSLionel Sambuc // Information Format standard document on http://www.dwarfstd.org. This
16*0a6a1f1dSLionel Sambuc // file often includes support for non-released standard features.
17f4a2713aSLionel Sambuc //
18f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
19f4a2713aSLionel Sambuc 
20f4a2713aSLionel Sambuc #ifndef LLVM_SUPPORT_DWARF_H
21f4a2713aSLionel Sambuc #define LLVM_SUPPORT_DWARF_H
22f4a2713aSLionel Sambuc 
23f4a2713aSLionel Sambuc #include "llvm/Support/Compiler.h"
24f4a2713aSLionel Sambuc #include "llvm/Support/DataTypes.h"
25f4a2713aSLionel Sambuc 
26f4a2713aSLionel Sambuc namespace llvm {
27f4a2713aSLionel Sambuc 
28f4a2713aSLionel Sambuc namespace dwarf {
29f4a2713aSLionel Sambuc 
30f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
31f4a2713aSLionel Sambuc // Dwarf constants as gleaned from the DWARF Debugging Information Format V.4
32*0a6a1f1dSLionel Sambuc // reference manual http://www.dwarfstd.org/.
33f4a2713aSLionel Sambuc //
34f4a2713aSLionel Sambuc 
35f4a2713aSLionel Sambuc // Do not mix the following two enumerations sets.  DW_TAG_invalid changes the
36f4a2713aSLionel Sambuc // enumeration base type.
37f4a2713aSLionel Sambuc 
38*0a6a1f1dSLionel Sambuc enum LLVMConstants : uint32_t {
39f4a2713aSLionel Sambuc   // llvm mock tags
40f4a2713aSLionel Sambuc   DW_TAG_invalid = ~0U, // Tag for invalid results.
41f4a2713aSLionel Sambuc 
42f4a2713aSLionel Sambuc   DW_TAG_auto_variable = 0x100, // Tag for local (auto) variables.
43f4a2713aSLionel Sambuc   DW_TAG_arg_variable = 0x101,  // Tag for argument variables.
44*0a6a1f1dSLionel Sambuc   DW_TAG_expression = 0x102,    // Tag for complex address expressions.
45f4a2713aSLionel Sambuc 
46f4a2713aSLionel Sambuc   DW_TAG_user_base = 0x1000, // Recommended base for user tags.
47f4a2713aSLionel Sambuc 
48f4a2713aSLionel Sambuc   DWARF_VERSION = 4,       // Default dwarf version we output.
49f4a2713aSLionel Sambuc   DW_PUBTYPES_VERSION = 2, // Section version number for .debug_pubtypes.
50f4a2713aSLionel Sambuc   DW_PUBNAMES_VERSION = 2, // Section version number for .debug_pubnames.
51f4a2713aSLionel Sambuc   DW_ARANGES_VERSION = 2   // Section version number for .debug_aranges.
52f4a2713aSLionel Sambuc };
53f4a2713aSLionel Sambuc 
54f4a2713aSLionel Sambuc // Special ID values that distinguish a CIE from a FDE in DWARF CFI.
55f4a2713aSLionel Sambuc // Not inside an enum because a 64-bit value is needed.
56f4a2713aSLionel Sambuc const uint32_t DW_CIE_ID = UINT32_MAX;
57f4a2713aSLionel Sambuc const uint64_t DW64_CIE_ID = UINT64_MAX;
58f4a2713aSLionel Sambuc 
59*0a6a1f1dSLionel Sambuc enum Tag : uint16_t {
60f4a2713aSLionel Sambuc   DW_TAG_array_type = 0x01,
61f4a2713aSLionel Sambuc   DW_TAG_class_type = 0x02,
62f4a2713aSLionel Sambuc   DW_TAG_entry_point = 0x03,
63f4a2713aSLionel Sambuc   DW_TAG_enumeration_type = 0x04,
64f4a2713aSLionel Sambuc   DW_TAG_formal_parameter = 0x05,
65f4a2713aSLionel Sambuc   DW_TAG_imported_declaration = 0x08,
66f4a2713aSLionel Sambuc   DW_TAG_label = 0x0a,
67f4a2713aSLionel Sambuc   DW_TAG_lexical_block = 0x0b,
68f4a2713aSLionel Sambuc   DW_TAG_member = 0x0d,
69f4a2713aSLionel Sambuc   DW_TAG_pointer_type = 0x0f,
70f4a2713aSLionel Sambuc   DW_TAG_reference_type = 0x10,
71f4a2713aSLionel Sambuc   DW_TAG_compile_unit = 0x11,
72f4a2713aSLionel Sambuc   DW_TAG_string_type = 0x12,
73f4a2713aSLionel Sambuc   DW_TAG_structure_type = 0x13,
74f4a2713aSLionel Sambuc   DW_TAG_subroutine_type = 0x15,
75f4a2713aSLionel Sambuc   DW_TAG_typedef = 0x16,
76f4a2713aSLionel Sambuc   DW_TAG_union_type = 0x17,
77f4a2713aSLionel Sambuc   DW_TAG_unspecified_parameters = 0x18,
78f4a2713aSLionel Sambuc   DW_TAG_variant = 0x19,
79f4a2713aSLionel Sambuc   DW_TAG_common_block = 0x1a,
80f4a2713aSLionel Sambuc   DW_TAG_common_inclusion = 0x1b,
81f4a2713aSLionel Sambuc   DW_TAG_inheritance = 0x1c,
82f4a2713aSLionel Sambuc   DW_TAG_inlined_subroutine = 0x1d,
83f4a2713aSLionel Sambuc   DW_TAG_module = 0x1e,
84f4a2713aSLionel Sambuc   DW_TAG_ptr_to_member_type = 0x1f,
85f4a2713aSLionel Sambuc   DW_TAG_set_type = 0x20,
86f4a2713aSLionel Sambuc   DW_TAG_subrange_type = 0x21,
87f4a2713aSLionel Sambuc   DW_TAG_with_stmt = 0x22,
88f4a2713aSLionel Sambuc   DW_TAG_access_declaration = 0x23,
89f4a2713aSLionel Sambuc   DW_TAG_base_type = 0x24,
90f4a2713aSLionel Sambuc   DW_TAG_catch_block = 0x25,
91f4a2713aSLionel Sambuc   DW_TAG_const_type = 0x26,
92f4a2713aSLionel Sambuc   DW_TAG_constant = 0x27,
93f4a2713aSLionel Sambuc   DW_TAG_enumerator = 0x28,
94f4a2713aSLionel Sambuc   DW_TAG_file_type = 0x29,
95f4a2713aSLionel Sambuc   DW_TAG_friend = 0x2a,
96f4a2713aSLionel Sambuc   DW_TAG_namelist = 0x2b,
97f4a2713aSLionel Sambuc   DW_TAG_namelist_item = 0x2c,
98f4a2713aSLionel Sambuc   DW_TAG_packed_type = 0x2d,
99f4a2713aSLionel Sambuc   DW_TAG_subprogram = 0x2e,
100f4a2713aSLionel Sambuc   DW_TAG_template_type_parameter = 0x2f,
101f4a2713aSLionel Sambuc   DW_TAG_template_value_parameter = 0x30,
102f4a2713aSLionel Sambuc   DW_TAG_thrown_type = 0x31,
103f4a2713aSLionel Sambuc   DW_TAG_try_block = 0x32,
104f4a2713aSLionel Sambuc   DW_TAG_variant_part = 0x33,
105f4a2713aSLionel Sambuc   DW_TAG_variable = 0x34,
106f4a2713aSLionel Sambuc   DW_TAG_volatile_type = 0x35,
107f4a2713aSLionel Sambuc   DW_TAG_dwarf_procedure = 0x36,
108f4a2713aSLionel Sambuc   DW_TAG_restrict_type = 0x37,
109f4a2713aSLionel Sambuc   DW_TAG_interface_type = 0x38,
110f4a2713aSLionel Sambuc   DW_TAG_namespace = 0x39,
111f4a2713aSLionel Sambuc   DW_TAG_imported_module = 0x3a,
112f4a2713aSLionel Sambuc   DW_TAG_unspecified_type = 0x3b,
113f4a2713aSLionel Sambuc   DW_TAG_partial_unit = 0x3c,
114f4a2713aSLionel Sambuc   DW_TAG_imported_unit = 0x3d,
115f4a2713aSLionel Sambuc   DW_TAG_condition = 0x3f,
116f4a2713aSLionel Sambuc   DW_TAG_shared_type = 0x40,
117f4a2713aSLionel Sambuc   DW_TAG_type_unit = 0x41,
118f4a2713aSLionel Sambuc   DW_TAG_rvalue_reference_type = 0x42,
119f4a2713aSLionel Sambuc   DW_TAG_template_alias = 0x43,
120*0a6a1f1dSLionel Sambuc 
121*0a6a1f1dSLionel Sambuc   // New in DWARF 5:
122*0a6a1f1dSLionel Sambuc   DW_TAG_coarray_type = 0x44,
123*0a6a1f1dSLionel Sambuc   DW_TAG_generic_subrange = 0x45,
124*0a6a1f1dSLionel Sambuc   DW_TAG_dynamic_type = 0x46,
125*0a6a1f1dSLionel Sambuc 
126f4a2713aSLionel Sambuc   DW_TAG_MIPS_loop = 0x4081,
127f4a2713aSLionel Sambuc   DW_TAG_format_label = 0x4101,
128f4a2713aSLionel Sambuc   DW_TAG_function_template = 0x4102,
129f4a2713aSLionel Sambuc   DW_TAG_class_template = 0x4103,
130f4a2713aSLionel Sambuc   DW_TAG_GNU_template_template_param = 0x4106,
131f4a2713aSLionel Sambuc   DW_TAG_GNU_template_parameter_pack = 0x4107,
132f4a2713aSLionel Sambuc   DW_TAG_GNU_formal_parameter_pack = 0x4108,
133f4a2713aSLionel Sambuc   DW_TAG_lo_user = 0x4080,
134f4a2713aSLionel Sambuc   DW_TAG_APPLE_property = 0x4200,
135f4a2713aSLionel Sambuc   DW_TAG_hi_user = 0xffff
136f4a2713aSLionel Sambuc };
137f4a2713aSLionel Sambuc 
isType(Tag T)138f4a2713aSLionel Sambuc inline bool isType(Tag T) {
139f4a2713aSLionel Sambuc   switch (T) {
140f4a2713aSLionel Sambuc   case DW_TAG_array_type:
141f4a2713aSLionel Sambuc   case DW_TAG_class_type:
142f4a2713aSLionel Sambuc   case DW_TAG_interface_type:
143f4a2713aSLionel Sambuc   case DW_TAG_enumeration_type:
144f4a2713aSLionel Sambuc   case DW_TAG_pointer_type:
145f4a2713aSLionel Sambuc   case DW_TAG_reference_type:
146f4a2713aSLionel Sambuc   case DW_TAG_rvalue_reference_type:
147f4a2713aSLionel Sambuc   case DW_TAG_string_type:
148f4a2713aSLionel Sambuc   case DW_TAG_structure_type:
149f4a2713aSLionel Sambuc   case DW_TAG_subroutine_type:
150f4a2713aSLionel Sambuc   case DW_TAG_union_type:
151f4a2713aSLionel Sambuc   case DW_TAG_ptr_to_member_type:
152f4a2713aSLionel Sambuc   case DW_TAG_set_type:
153f4a2713aSLionel Sambuc   case DW_TAG_subrange_type:
154f4a2713aSLionel Sambuc   case DW_TAG_base_type:
155f4a2713aSLionel Sambuc   case DW_TAG_const_type:
156f4a2713aSLionel Sambuc   case DW_TAG_file_type:
157f4a2713aSLionel Sambuc   case DW_TAG_packed_type:
158f4a2713aSLionel Sambuc   case DW_TAG_volatile_type:
159f4a2713aSLionel Sambuc   case DW_TAG_typedef:
160f4a2713aSLionel Sambuc     return true;
161f4a2713aSLionel Sambuc   default:
162f4a2713aSLionel Sambuc     return false;
163f4a2713aSLionel Sambuc   }
164f4a2713aSLionel Sambuc }
165f4a2713aSLionel Sambuc 
166*0a6a1f1dSLionel Sambuc enum Attribute : uint16_t {
167f4a2713aSLionel Sambuc   // Attributes
168f4a2713aSLionel Sambuc   DW_AT_sibling = 0x01,
169f4a2713aSLionel Sambuc   DW_AT_location = 0x02,
170f4a2713aSLionel Sambuc   DW_AT_name = 0x03,
171f4a2713aSLionel Sambuc   DW_AT_ordering = 0x09,
172f4a2713aSLionel Sambuc   DW_AT_byte_size = 0x0b,
173f4a2713aSLionel Sambuc   DW_AT_bit_offset = 0x0c,
174f4a2713aSLionel Sambuc   DW_AT_bit_size = 0x0d,
175f4a2713aSLionel Sambuc   DW_AT_stmt_list = 0x10,
176f4a2713aSLionel Sambuc   DW_AT_low_pc = 0x11,
177f4a2713aSLionel Sambuc   DW_AT_high_pc = 0x12,
178f4a2713aSLionel Sambuc   DW_AT_language = 0x13,
179f4a2713aSLionel Sambuc   DW_AT_discr = 0x15,
180f4a2713aSLionel Sambuc   DW_AT_discr_value = 0x16,
181f4a2713aSLionel Sambuc   DW_AT_visibility = 0x17,
182f4a2713aSLionel Sambuc   DW_AT_import = 0x18,
183f4a2713aSLionel Sambuc   DW_AT_string_length = 0x19,
184f4a2713aSLionel Sambuc   DW_AT_common_reference = 0x1a,
185f4a2713aSLionel Sambuc   DW_AT_comp_dir = 0x1b,
186f4a2713aSLionel Sambuc   DW_AT_const_value = 0x1c,
187f4a2713aSLionel Sambuc   DW_AT_containing_type = 0x1d,
188f4a2713aSLionel Sambuc   DW_AT_default_value = 0x1e,
189f4a2713aSLionel Sambuc   DW_AT_inline = 0x20,
190f4a2713aSLionel Sambuc   DW_AT_is_optional = 0x21,
191f4a2713aSLionel Sambuc   DW_AT_lower_bound = 0x22,
192f4a2713aSLionel Sambuc   DW_AT_producer = 0x25,
193f4a2713aSLionel Sambuc   DW_AT_prototyped = 0x27,
194f4a2713aSLionel Sambuc   DW_AT_return_addr = 0x2a,
195f4a2713aSLionel Sambuc   DW_AT_start_scope = 0x2c,
196f4a2713aSLionel Sambuc   DW_AT_bit_stride = 0x2e,
197f4a2713aSLionel Sambuc   DW_AT_upper_bound = 0x2f,
198f4a2713aSLionel Sambuc   DW_AT_abstract_origin = 0x31,
199f4a2713aSLionel Sambuc   DW_AT_accessibility = 0x32,
200f4a2713aSLionel Sambuc   DW_AT_address_class = 0x33,
201f4a2713aSLionel Sambuc   DW_AT_artificial = 0x34,
202f4a2713aSLionel Sambuc   DW_AT_base_types = 0x35,
203f4a2713aSLionel Sambuc   DW_AT_calling_convention = 0x36,
204f4a2713aSLionel Sambuc   DW_AT_count = 0x37,
205f4a2713aSLionel Sambuc   DW_AT_data_member_location = 0x38,
206f4a2713aSLionel Sambuc   DW_AT_decl_column = 0x39,
207f4a2713aSLionel Sambuc   DW_AT_decl_file = 0x3a,
208f4a2713aSLionel Sambuc   DW_AT_decl_line = 0x3b,
209f4a2713aSLionel Sambuc   DW_AT_declaration = 0x3c,
210f4a2713aSLionel Sambuc   DW_AT_discr_list = 0x3d,
211f4a2713aSLionel Sambuc   DW_AT_encoding = 0x3e,
212f4a2713aSLionel Sambuc   DW_AT_external = 0x3f,
213f4a2713aSLionel Sambuc   DW_AT_frame_base = 0x40,
214f4a2713aSLionel Sambuc   DW_AT_friend = 0x41,
215f4a2713aSLionel Sambuc   DW_AT_identifier_case = 0x42,
216f4a2713aSLionel Sambuc   DW_AT_macro_info = 0x43,
217f4a2713aSLionel Sambuc   DW_AT_namelist_item = 0x44,
218f4a2713aSLionel Sambuc   DW_AT_priority = 0x45,
219f4a2713aSLionel Sambuc   DW_AT_segment = 0x46,
220f4a2713aSLionel Sambuc   DW_AT_specification = 0x47,
221f4a2713aSLionel Sambuc   DW_AT_static_link = 0x48,
222f4a2713aSLionel Sambuc   DW_AT_type = 0x49,
223f4a2713aSLionel Sambuc   DW_AT_use_location = 0x4a,
224f4a2713aSLionel Sambuc   DW_AT_variable_parameter = 0x4b,
225f4a2713aSLionel Sambuc   DW_AT_virtuality = 0x4c,
226f4a2713aSLionel Sambuc   DW_AT_vtable_elem_location = 0x4d,
227f4a2713aSLionel Sambuc   DW_AT_allocated = 0x4e,
228f4a2713aSLionel Sambuc   DW_AT_associated = 0x4f,
229f4a2713aSLionel Sambuc   DW_AT_data_location = 0x50,
230f4a2713aSLionel Sambuc   DW_AT_byte_stride = 0x51,
231f4a2713aSLionel Sambuc   DW_AT_entry_pc = 0x52,
232f4a2713aSLionel Sambuc   DW_AT_use_UTF8 = 0x53,
233f4a2713aSLionel Sambuc   DW_AT_extension = 0x54,
234f4a2713aSLionel Sambuc   DW_AT_ranges = 0x55,
235f4a2713aSLionel Sambuc   DW_AT_trampoline = 0x56,
236f4a2713aSLionel Sambuc   DW_AT_call_column = 0x57,
237f4a2713aSLionel Sambuc   DW_AT_call_file = 0x58,
238f4a2713aSLionel Sambuc   DW_AT_call_line = 0x59,
239f4a2713aSLionel Sambuc   DW_AT_description = 0x5a,
240f4a2713aSLionel Sambuc   DW_AT_binary_scale = 0x5b,
241f4a2713aSLionel Sambuc   DW_AT_decimal_scale = 0x5c,
242f4a2713aSLionel Sambuc   DW_AT_small = 0x5d,
243f4a2713aSLionel Sambuc   DW_AT_decimal_sign = 0x5e,
244f4a2713aSLionel Sambuc   DW_AT_digit_count = 0x5f,
245f4a2713aSLionel Sambuc   DW_AT_picture_string = 0x60,
246f4a2713aSLionel Sambuc   DW_AT_mutable = 0x61,
247f4a2713aSLionel Sambuc   DW_AT_threads_scaled = 0x62,
248f4a2713aSLionel Sambuc   DW_AT_explicit = 0x63,
249f4a2713aSLionel Sambuc   DW_AT_object_pointer = 0x64,
250f4a2713aSLionel Sambuc   DW_AT_endianity = 0x65,
251f4a2713aSLionel Sambuc   DW_AT_elemental = 0x66,
252f4a2713aSLionel Sambuc   DW_AT_pure = 0x67,
253f4a2713aSLionel Sambuc   DW_AT_recursive = 0x68,
254f4a2713aSLionel Sambuc   DW_AT_signature = 0x69,
255f4a2713aSLionel Sambuc   DW_AT_main_subprogram = 0x6a,
256f4a2713aSLionel Sambuc   DW_AT_data_bit_offset = 0x6b,
257f4a2713aSLionel Sambuc   DW_AT_const_expr = 0x6c,
258f4a2713aSLionel Sambuc   DW_AT_enum_class = 0x6d,
259f4a2713aSLionel Sambuc   DW_AT_linkage_name = 0x6e,
260f4a2713aSLionel Sambuc 
261*0a6a1f1dSLionel Sambuc   // New in DWARF 5:
262*0a6a1f1dSLionel Sambuc   DW_AT_string_length_bit_size = 0x6f,
263*0a6a1f1dSLionel Sambuc   DW_AT_string_length_byte_size = 0x70,
264*0a6a1f1dSLionel Sambuc   DW_AT_rank = 0x71,
265*0a6a1f1dSLionel Sambuc   DW_AT_str_offsets_base = 0x72,
266*0a6a1f1dSLionel Sambuc   DW_AT_addr_base = 0x73,
267*0a6a1f1dSLionel Sambuc   DW_AT_ranges_base = 0x74,
268*0a6a1f1dSLionel Sambuc   DW_AT_dwo_id = 0x75,
269*0a6a1f1dSLionel Sambuc   DW_AT_dwo_name = 0x76,
270*0a6a1f1dSLionel Sambuc   DW_AT_reference = 0x77,
271*0a6a1f1dSLionel Sambuc   DW_AT_rvalue_reference = 0x78,
272*0a6a1f1dSLionel Sambuc 
273f4a2713aSLionel Sambuc   DW_AT_lo_user = 0x2000,
274f4a2713aSLionel Sambuc   DW_AT_hi_user = 0x3fff,
275f4a2713aSLionel Sambuc 
276f4a2713aSLionel Sambuc   DW_AT_MIPS_loop_begin = 0x2002,
277f4a2713aSLionel Sambuc   DW_AT_MIPS_tail_loop_begin = 0x2003,
278f4a2713aSLionel Sambuc   DW_AT_MIPS_epilog_begin = 0x2004,
279f4a2713aSLionel Sambuc   DW_AT_MIPS_loop_unroll_factor = 0x2005,
280f4a2713aSLionel Sambuc   DW_AT_MIPS_software_pipeline_depth = 0x2006,
281f4a2713aSLionel Sambuc   DW_AT_MIPS_linkage_name = 0x2007,
282f4a2713aSLionel Sambuc   DW_AT_MIPS_stride = 0x2008,
283f4a2713aSLionel Sambuc   DW_AT_MIPS_abstract_name = 0x2009,
284f4a2713aSLionel Sambuc   DW_AT_MIPS_clone_origin = 0x200a,
285f4a2713aSLionel Sambuc   DW_AT_MIPS_has_inlines = 0x200b,
286f4a2713aSLionel Sambuc   DW_AT_MIPS_stride_byte = 0x200c,
287f4a2713aSLionel Sambuc   DW_AT_MIPS_stride_elem = 0x200d,
288f4a2713aSLionel Sambuc   DW_AT_MIPS_ptr_dopetype = 0x200e,
289f4a2713aSLionel Sambuc   DW_AT_MIPS_allocatable_dopetype = 0x200f,
290f4a2713aSLionel Sambuc   DW_AT_MIPS_assumed_shape_dopetype = 0x2010,
291f4a2713aSLionel Sambuc 
292f4a2713aSLionel Sambuc   // This one appears to have only been implemented by Open64 for
293f4a2713aSLionel Sambuc   // fortran and may conflict with other extensions.
294f4a2713aSLionel Sambuc   DW_AT_MIPS_assumed_size = 0x2011,
295f4a2713aSLionel Sambuc 
296f4a2713aSLionel Sambuc   // GNU extensions
297f4a2713aSLionel Sambuc   DW_AT_sf_names = 0x2101,
298f4a2713aSLionel Sambuc   DW_AT_src_info = 0x2102,
299f4a2713aSLionel Sambuc   DW_AT_mac_info = 0x2103,
300f4a2713aSLionel Sambuc   DW_AT_src_coords = 0x2104,
301f4a2713aSLionel Sambuc   DW_AT_body_begin = 0x2105,
302f4a2713aSLionel Sambuc   DW_AT_body_end = 0x2106,
303f4a2713aSLionel Sambuc   DW_AT_GNU_vector = 0x2107,
304f4a2713aSLionel Sambuc   DW_AT_GNU_template_name = 0x2110,
305f4a2713aSLionel Sambuc 
306f4a2713aSLionel Sambuc   DW_AT_GNU_odr_signature = 0x210f,
307f4a2713aSLionel Sambuc 
308f4a2713aSLionel Sambuc   // Extensions for Fission proposal.
309f4a2713aSLionel Sambuc   DW_AT_GNU_dwo_name = 0x2130,
310f4a2713aSLionel Sambuc   DW_AT_GNU_dwo_id = 0x2131,
311f4a2713aSLionel Sambuc   DW_AT_GNU_ranges_base = 0x2132,
312f4a2713aSLionel Sambuc   DW_AT_GNU_addr_base = 0x2133,
313f4a2713aSLionel Sambuc   DW_AT_GNU_pubnames = 0x2134,
314f4a2713aSLionel Sambuc   DW_AT_GNU_pubtypes = 0x2135,
315f4a2713aSLionel Sambuc 
316f4a2713aSLionel Sambuc   // Apple extensions.
317f4a2713aSLionel Sambuc   DW_AT_APPLE_optimized = 0x3fe1,
318f4a2713aSLionel Sambuc   DW_AT_APPLE_flags = 0x3fe2,
319f4a2713aSLionel Sambuc   DW_AT_APPLE_isa = 0x3fe3,
320f4a2713aSLionel Sambuc   DW_AT_APPLE_block = 0x3fe4,
321f4a2713aSLionel Sambuc   DW_AT_APPLE_major_runtime_vers = 0x3fe5,
322f4a2713aSLionel Sambuc   DW_AT_APPLE_runtime_class = 0x3fe6,
323f4a2713aSLionel Sambuc   DW_AT_APPLE_omit_frame_ptr = 0x3fe7,
324f4a2713aSLionel Sambuc   DW_AT_APPLE_property_name = 0x3fe8,
325f4a2713aSLionel Sambuc   DW_AT_APPLE_property_getter = 0x3fe9,
326f4a2713aSLionel Sambuc   DW_AT_APPLE_property_setter = 0x3fea,
327f4a2713aSLionel Sambuc   DW_AT_APPLE_property_attribute = 0x3feb,
328f4a2713aSLionel Sambuc   DW_AT_APPLE_objc_complete_type = 0x3fec,
329f4a2713aSLionel Sambuc   DW_AT_APPLE_property = 0x3fed
330f4a2713aSLionel Sambuc };
331f4a2713aSLionel Sambuc 
332*0a6a1f1dSLionel Sambuc enum Form : uint16_t {
333f4a2713aSLionel Sambuc   // Attribute form encodings
334f4a2713aSLionel Sambuc   DW_FORM_addr = 0x01,
335f4a2713aSLionel Sambuc   DW_FORM_block2 = 0x03,
336f4a2713aSLionel Sambuc   DW_FORM_block4 = 0x04,
337f4a2713aSLionel Sambuc   DW_FORM_data2 = 0x05,
338f4a2713aSLionel Sambuc   DW_FORM_data4 = 0x06,
339f4a2713aSLionel Sambuc   DW_FORM_data8 = 0x07,
340f4a2713aSLionel Sambuc   DW_FORM_string = 0x08,
341f4a2713aSLionel Sambuc   DW_FORM_block = 0x09,
342f4a2713aSLionel Sambuc   DW_FORM_block1 = 0x0a,
343f4a2713aSLionel Sambuc   DW_FORM_data1 = 0x0b,
344f4a2713aSLionel Sambuc   DW_FORM_flag = 0x0c,
345f4a2713aSLionel Sambuc   DW_FORM_sdata = 0x0d,
346f4a2713aSLionel Sambuc   DW_FORM_strp = 0x0e,
347f4a2713aSLionel Sambuc   DW_FORM_udata = 0x0f,
348f4a2713aSLionel Sambuc   DW_FORM_ref_addr = 0x10,
349f4a2713aSLionel Sambuc   DW_FORM_ref1 = 0x11,
350f4a2713aSLionel Sambuc   DW_FORM_ref2 = 0x12,
351f4a2713aSLionel Sambuc   DW_FORM_ref4 = 0x13,
352f4a2713aSLionel Sambuc   DW_FORM_ref8 = 0x14,
353f4a2713aSLionel Sambuc   DW_FORM_ref_udata = 0x15,
354f4a2713aSLionel Sambuc   DW_FORM_indirect = 0x16,
355f4a2713aSLionel Sambuc   DW_FORM_sec_offset = 0x17,
356f4a2713aSLionel Sambuc   DW_FORM_exprloc = 0x18,
357f4a2713aSLionel Sambuc   DW_FORM_flag_present = 0x19,
358f4a2713aSLionel Sambuc   DW_FORM_ref_sig8 = 0x20,
359f4a2713aSLionel Sambuc 
360f4a2713aSLionel Sambuc   // Extensions for Fission proposal
361f4a2713aSLionel Sambuc   DW_FORM_GNU_addr_index = 0x1f01,
362f4a2713aSLionel Sambuc   DW_FORM_GNU_str_index = 0x1f02
363f4a2713aSLionel Sambuc };
364f4a2713aSLionel Sambuc 
365f4a2713aSLionel Sambuc enum LocationAtom {
366f4a2713aSLionel Sambuc   // Operation encodings
367f4a2713aSLionel Sambuc   DW_OP_addr = 0x03,
368f4a2713aSLionel Sambuc   DW_OP_deref = 0x06,
369f4a2713aSLionel Sambuc   DW_OP_const1u = 0x08,
370f4a2713aSLionel Sambuc   DW_OP_const1s = 0x09,
371f4a2713aSLionel Sambuc   DW_OP_const2u = 0x0a,
372f4a2713aSLionel Sambuc   DW_OP_const2s = 0x0b,
373f4a2713aSLionel Sambuc   DW_OP_const4u = 0x0c,
374f4a2713aSLionel Sambuc   DW_OP_const4s = 0x0d,
375f4a2713aSLionel Sambuc   DW_OP_const8u = 0x0e,
376f4a2713aSLionel Sambuc   DW_OP_const8s = 0x0f,
377f4a2713aSLionel Sambuc   DW_OP_constu = 0x10,
378f4a2713aSLionel Sambuc   DW_OP_consts = 0x11,
379f4a2713aSLionel Sambuc   DW_OP_dup = 0x12,
380f4a2713aSLionel Sambuc   DW_OP_drop = 0x13,
381f4a2713aSLionel Sambuc   DW_OP_over = 0x14,
382f4a2713aSLionel Sambuc   DW_OP_pick = 0x15,
383f4a2713aSLionel Sambuc   DW_OP_swap = 0x16,
384f4a2713aSLionel Sambuc   DW_OP_rot = 0x17,
385f4a2713aSLionel Sambuc   DW_OP_xderef = 0x18,
386f4a2713aSLionel Sambuc   DW_OP_abs = 0x19,
387f4a2713aSLionel Sambuc   DW_OP_and = 0x1a,
388f4a2713aSLionel Sambuc   DW_OP_div = 0x1b,
389f4a2713aSLionel Sambuc   DW_OP_minus = 0x1c,
390f4a2713aSLionel Sambuc   DW_OP_mod = 0x1d,
391f4a2713aSLionel Sambuc   DW_OP_mul = 0x1e,
392f4a2713aSLionel Sambuc   DW_OP_neg = 0x1f,
393f4a2713aSLionel Sambuc   DW_OP_not = 0x20,
394f4a2713aSLionel Sambuc   DW_OP_or = 0x21,
395f4a2713aSLionel Sambuc   DW_OP_plus = 0x22,
396f4a2713aSLionel Sambuc   DW_OP_plus_uconst = 0x23,
397f4a2713aSLionel Sambuc   DW_OP_shl = 0x24,
398f4a2713aSLionel Sambuc   DW_OP_shr = 0x25,
399f4a2713aSLionel Sambuc   DW_OP_shra = 0x26,
400f4a2713aSLionel Sambuc   DW_OP_xor = 0x27,
401f4a2713aSLionel Sambuc   DW_OP_skip = 0x2f,
402f4a2713aSLionel Sambuc   DW_OP_bra = 0x28,
403f4a2713aSLionel Sambuc   DW_OP_eq = 0x29,
404f4a2713aSLionel Sambuc   DW_OP_ge = 0x2a,
405f4a2713aSLionel Sambuc   DW_OP_gt = 0x2b,
406f4a2713aSLionel Sambuc   DW_OP_le = 0x2c,
407f4a2713aSLionel Sambuc   DW_OP_lt = 0x2d,
408f4a2713aSLionel Sambuc   DW_OP_ne = 0x2e,
409f4a2713aSLionel Sambuc   DW_OP_lit0 = 0x30,
410f4a2713aSLionel Sambuc   DW_OP_lit1 = 0x31,
411f4a2713aSLionel Sambuc   DW_OP_lit2 = 0x32,
412f4a2713aSLionel Sambuc   DW_OP_lit3 = 0x33,
413f4a2713aSLionel Sambuc   DW_OP_lit4 = 0x34,
414f4a2713aSLionel Sambuc   DW_OP_lit5 = 0x35,
415f4a2713aSLionel Sambuc   DW_OP_lit6 = 0x36,
416f4a2713aSLionel Sambuc   DW_OP_lit7 = 0x37,
417f4a2713aSLionel Sambuc   DW_OP_lit8 = 0x38,
418f4a2713aSLionel Sambuc   DW_OP_lit9 = 0x39,
419f4a2713aSLionel Sambuc   DW_OP_lit10 = 0x3a,
420f4a2713aSLionel Sambuc   DW_OP_lit11 = 0x3b,
421f4a2713aSLionel Sambuc   DW_OP_lit12 = 0x3c,
422f4a2713aSLionel Sambuc   DW_OP_lit13 = 0x3d,
423f4a2713aSLionel Sambuc   DW_OP_lit14 = 0x3e,
424f4a2713aSLionel Sambuc   DW_OP_lit15 = 0x3f,
425f4a2713aSLionel Sambuc   DW_OP_lit16 = 0x40,
426f4a2713aSLionel Sambuc   DW_OP_lit17 = 0x41,
427f4a2713aSLionel Sambuc   DW_OP_lit18 = 0x42,
428f4a2713aSLionel Sambuc   DW_OP_lit19 = 0x43,
429f4a2713aSLionel Sambuc   DW_OP_lit20 = 0x44,
430f4a2713aSLionel Sambuc   DW_OP_lit21 = 0x45,
431f4a2713aSLionel Sambuc   DW_OP_lit22 = 0x46,
432f4a2713aSLionel Sambuc   DW_OP_lit23 = 0x47,
433f4a2713aSLionel Sambuc   DW_OP_lit24 = 0x48,
434f4a2713aSLionel Sambuc   DW_OP_lit25 = 0x49,
435f4a2713aSLionel Sambuc   DW_OP_lit26 = 0x4a,
436f4a2713aSLionel Sambuc   DW_OP_lit27 = 0x4b,
437f4a2713aSLionel Sambuc   DW_OP_lit28 = 0x4c,
438f4a2713aSLionel Sambuc   DW_OP_lit29 = 0x4d,
439f4a2713aSLionel Sambuc   DW_OP_lit30 = 0x4e,
440f4a2713aSLionel Sambuc   DW_OP_lit31 = 0x4f,
441f4a2713aSLionel Sambuc   DW_OP_reg0 = 0x50,
442f4a2713aSLionel Sambuc   DW_OP_reg1 = 0x51,
443f4a2713aSLionel Sambuc   DW_OP_reg2 = 0x52,
444f4a2713aSLionel Sambuc   DW_OP_reg3 = 0x53,
445f4a2713aSLionel Sambuc   DW_OP_reg4 = 0x54,
446f4a2713aSLionel Sambuc   DW_OP_reg5 = 0x55,
447f4a2713aSLionel Sambuc   DW_OP_reg6 = 0x56,
448f4a2713aSLionel Sambuc   DW_OP_reg7 = 0x57,
449f4a2713aSLionel Sambuc   DW_OP_reg8 = 0x58,
450f4a2713aSLionel Sambuc   DW_OP_reg9 = 0x59,
451f4a2713aSLionel Sambuc   DW_OP_reg10 = 0x5a,
452f4a2713aSLionel Sambuc   DW_OP_reg11 = 0x5b,
453f4a2713aSLionel Sambuc   DW_OP_reg12 = 0x5c,
454f4a2713aSLionel Sambuc   DW_OP_reg13 = 0x5d,
455f4a2713aSLionel Sambuc   DW_OP_reg14 = 0x5e,
456f4a2713aSLionel Sambuc   DW_OP_reg15 = 0x5f,
457f4a2713aSLionel Sambuc   DW_OP_reg16 = 0x60,
458f4a2713aSLionel Sambuc   DW_OP_reg17 = 0x61,
459f4a2713aSLionel Sambuc   DW_OP_reg18 = 0x62,
460f4a2713aSLionel Sambuc   DW_OP_reg19 = 0x63,
461f4a2713aSLionel Sambuc   DW_OP_reg20 = 0x64,
462f4a2713aSLionel Sambuc   DW_OP_reg21 = 0x65,
463f4a2713aSLionel Sambuc   DW_OP_reg22 = 0x66,
464f4a2713aSLionel Sambuc   DW_OP_reg23 = 0x67,
465f4a2713aSLionel Sambuc   DW_OP_reg24 = 0x68,
466f4a2713aSLionel Sambuc   DW_OP_reg25 = 0x69,
467f4a2713aSLionel Sambuc   DW_OP_reg26 = 0x6a,
468f4a2713aSLionel Sambuc   DW_OP_reg27 = 0x6b,
469f4a2713aSLionel Sambuc   DW_OP_reg28 = 0x6c,
470f4a2713aSLionel Sambuc   DW_OP_reg29 = 0x6d,
471f4a2713aSLionel Sambuc   DW_OP_reg30 = 0x6e,
472f4a2713aSLionel Sambuc   DW_OP_reg31 = 0x6f,
473f4a2713aSLionel Sambuc   DW_OP_breg0 = 0x70,
474f4a2713aSLionel Sambuc   DW_OP_breg1 = 0x71,
475f4a2713aSLionel Sambuc   DW_OP_breg2 = 0x72,
476f4a2713aSLionel Sambuc   DW_OP_breg3 = 0x73,
477f4a2713aSLionel Sambuc   DW_OP_breg4 = 0x74,
478f4a2713aSLionel Sambuc   DW_OP_breg5 = 0x75,
479f4a2713aSLionel Sambuc   DW_OP_breg6 = 0x76,
480f4a2713aSLionel Sambuc   DW_OP_breg7 = 0x77,
481f4a2713aSLionel Sambuc   DW_OP_breg8 = 0x78,
482f4a2713aSLionel Sambuc   DW_OP_breg9 = 0x79,
483f4a2713aSLionel Sambuc   DW_OP_breg10 = 0x7a,
484f4a2713aSLionel Sambuc   DW_OP_breg11 = 0x7b,
485f4a2713aSLionel Sambuc   DW_OP_breg12 = 0x7c,
486f4a2713aSLionel Sambuc   DW_OP_breg13 = 0x7d,
487f4a2713aSLionel Sambuc   DW_OP_breg14 = 0x7e,
488f4a2713aSLionel Sambuc   DW_OP_breg15 = 0x7f,
489f4a2713aSLionel Sambuc   DW_OP_breg16 = 0x80,
490f4a2713aSLionel Sambuc   DW_OP_breg17 = 0x81,
491f4a2713aSLionel Sambuc   DW_OP_breg18 = 0x82,
492f4a2713aSLionel Sambuc   DW_OP_breg19 = 0x83,
493f4a2713aSLionel Sambuc   DW_OP_breg20 = 0x84,
494f4a2713aSLionel Sambuc   DW_OP_breg21 = 0x85,
495f4a2713aSLionel Sambuc   DW_OP_breg22 = 0x86,
496f4a2713aSLionel Sambuc   DW_OP_breg23 = 0x87,
497f4a2713aSLionel Sambuc   DW_OP_breg24 = 0x88,
498f4a2713aSLionel Sambuc   DW_OP_breg25 = 0x89,
499f4a2713aSLionel Sambuc   DW_OP_breg26 = 0x8a,
500f4a2713aSLionel Sambuc   DW_OP_breg27 = 0x8b,
501f4a2713aSLionel Sambuc   DW_OP_breg28 = 0x8c,
502f4a2713aSLionel Sambuc   DW_OP_breg29 = 0x8d,
503f4a2713aSLionel Sambuc   DW_OP_breg30 = 0x8e,
504f4a2713aSLionel Sambuc   DW_OP_breg31 = 0x8f,
505f4a2713aSLionel Sambuc   DW_OP_regx = 0x90,
506f4a2713aSLionel Sambuc   DW_OP_fbreg = 0x91,
507f4a2713aSLionel Sambuc   DW_OP_bregx = 0x92,
508f4a2713aSLionel Sambuc   DW_OP_piece = 0x93,
509f4a2713aSLionel Sambuc   DW_OP_deref_size = 0x94,
510f4a2713aSLionel Sambuc   DW_OP_xderef_size = 0x95,
511f4a2713aSLionel Sambuc   DW_OP_nop = 0x96,
512f4a2713aSLionel Sambuc   DW_OP_push_object_address = 0x97,
513f4a2713aSLionel Sambuc   DW_OP_call2 = 0x98,
514f4a2713aSLionel Sambuc   DW_OP_call4 = 0x99,
515f4a2713aSLionel Sambuc   DW_OP_call_ref = 0x9a,
516f4a2713aSLionel Sambuc   DW_OP_form_tls_address = 0x9b,
517f4a2713aSLionel Sambuc   DW_OP_call_frame_cfa = 0x9c,
518f4a2713aSLionel Sambuc   DW_OP_bit_piece = 0x9d,
519f4a2713aSLionel Sambuc   DW_OP_implicit_value = 0x9e,
520f4a2713aSLionel Sambuc   DW_OP_stack_value = 0x9f,
521f4a2713aSLionel Sambuc   DW_OP_lo_user = 0xe0,
522f4a2713aSLionel Sambuc   DW_OP_hi_user = 0xff,
523f4a2713aSLionel Sambuc 
524f4a2713aSLionel Sambuc   // Extensions for GNU-style thread-local storage.
525f4a2713aSLionel Sambuc   DW_OP_GNU_push_tls_address = 0xe0,
526f4a2713aSLionel Sambuc 
527f4a2713aSLionel Sambuc   // Extensions for Fission proposal.
528f4a2713aSLionel Sambuc   DW_OP_GNU_addr_index = 0xfb,
529f4a2713aSLionel Sambuc   DW_OP_GNU_const_index = 0xfc
530f4a2713aSLionel Sambuc };
531f4a2713aSLionel Sambuc 
532f4a2713aSLionel Sambuc enum TypeKind {
533f4a2713aSLionel Sambuc   // Encoding attribute values
534f4a2713aSLionel Sambuc   DW_ATE_address = 0x01,
535f4a2713aSLionel Sambuc   DW_ATE_boolean = 0x02,
536f4a2713aSLionel Sambuc   DW_ATE_complex_float = 0x03,
537f4a2713aSLionel Sambuc   DW_ATE_float = 0x04,
538f4a2713aSLionel Sambuc   DW_ATE_signed = 0x05,
539f4a2713aSLionel Sambuc   DW_ATE_signed_char = 0x06,
540f4a2713aSLionel Sambuc   DW_ATE_unsigned = 0x07,
541f4a2713aSLionel Sambuc   DW_ATE_unsigned_char = 0x08,
542f4a2713aSLionel Sambuc   DW_ATE_imaginary_float = 0x09,
543f4a2713aSLionel Sambuc   DW_ATE_packed_decimal = 0x0a,
544f4a2713aSLionel Sambuc   DW_ATE_numeric_string = 0x0b,
545f4a2713aSLionel Sambuc   DW_ATE_edited = 0x0c,
546f4a2713aSLionel Sambuc   DW_ATE_signed_fixed = 0x0d,
547f4a2713aSLionel Sambuc   DW_ATE_unsigned_fixed = 0x0e,
548f4a2713aSLionel Sambuc   DW_ATE_decimal_float = 0x0f,
549f4a2713aSLionel Sambuc   DW_ATE_UTF = 0x10,
550f4a2713aSLionel Sambuc   DW_ATE_lo_user = 0x80,
551f4a2713aSLionel Sambuc   DW_ATE_hi_user = 0xff
552f4a2713aSLionel Sambuc };
553f4a2713aSLionel Sambuc 
554f4a2713aSLionel Sambuc enum DecimalSignEncoding {
555f4a2713aSLionel Sambuc   // Decimal sign attribute values
556f4a2713aSLionel Sambuc   DW_DS_unsigned = 0x01,
557f4a2713aSLionel Sambuc   DW_DS_leading_overpunch = 0x02,
558f4a2713aSLionel Sambuc   DW_DS_trailing_overpunch = 0x03,
559f4a2713aSLionel Sambuc   DW_DS_leading_separate = 0x04,
560f4a2713aSLionel Sambuc   DW_DS_trailing_separate = 0x05
561f4a2713aSLionel Sambuc };
562f4a2713aSLionel Sambuc 
563f4a2713aSLionel Sambuc enum EndianityEncoding {
564f4a2713aSLionel Sambuc   // Endianity attribute values
565f4a2713aSLionel Sambuc   DW_END_default = 0x00,
566f4a2713aSLionel Sambuc   DW_END_big = 0x01,
567f4a2713aSLionel Sambuc   DW_END_little = 0x02,
568f4a2713aSLionel Sambuc   DW_END_lo_user = 0x40,
569f4a2713aSLionel Sambuc   DW_END_hi_user = 0xff
570f4a2713aSLionel Sambuc };
571f4a2713aSLionel Sambuc 
572f4a2713aSLionel Sambuc enum AccessAttribute {
573f4a2713aSLionel Sambuc   // Accessibility codes
574f4a2713aSLionel Sambuc   DW_ACCESS_public = 0x01,
575f4a2713aSLionel Sambuc   DW_ACCESS_protected = 0x02,
576f4a2713aSLionel Sambuc   DW_ACCESS_private = 0x03
577f4a2713aSLionel Sambuc };
578f4a2713aSLionel Sambuc 
579f4a2713aSLionel Sambuc enum VisibilityAttribute {
580f4a2713aSLionel Sambuc   // Visibility codes
581f4a2713aSLionel Sambuc   DW_VIS_local = 0x01,
582f4a2713aSLionel Sambuc   DW_VIS_exported = 0x02,
583f4a2713aSLionel Sambuc   DW_VIS_qualified = 0x03
584f4a2713aSLionel Sambuc };
585f4a2713aSLionel Sambuc 
586f4a2713aSLionel Sambuc enum VirtualityAttribute {
587f4a2713aSLionel Sambuc   // Virtuality codes
588f4a2713aSLionel Sambuc   DW_VIRTUALITY_none = 0x00,
589f4a2713aSLionel Sambuc   DW_VIRTUALITY_virtual = 0x01,
590f4a2713aSLionel Sambuc   DW_VIRTUALITY_pure_virtual = 0x02
591f4a2713aSLionel Sambuc };
592f4a2713aSLionel Sambuc 
593f4a2713aSLionel Sambuc enum SourceLanguage {
594f4a2713aSLionel Sambuc   // Language names
595f4a2713aSLionel Sambuc   DW_LANG_C89 = 0x0001,
596f4a2713aSLionel Sambuc   DW_LANG_C = 0x0002,
597f4a2713aSLionel Sambuc   DW_LANG_Ada83 = 0x0003,
598f4a2713aSLionel Sambuc   DW_LANG_C_plus_plus = 0x0004,
599f4a2713aSLionel Sambuc   DW_LANG_Cobol74 = 0x0005,
600f4a2713aSLionel Sambuc   DW_LANG_Cobol85 = 0x0006,
601f4a2713aSLionel Sambuc   DW_LANG_Fortran77 = 0x0007,
602f4a2713aSLionel Sambuc   DW_LANG_Fortran90 = 0x0008,
603f4a2713aSLionel Sambuc   DW_LANG_Pascal83 = 0x0009,
604f4a2713aSLionel Sambuc   DW_LANG_Modula2 = 0x000a,
605f4a2713aSLionel Sambuc   DW_LANG_Java = 0x000b,
606f4a2713aSLionel Sambuc   DW_LANG_C99 = 0x000c,
607f4a2713aSLionel Sambuc   DW_LANG_Ada95 = 0x000d,
608f4a2713aSLionel Sambuc   DW_LANG_Fortran95 = 0x000e,
609f4a2713aSLionel Sambuc   DW_LANG_PLI = 0x000f,
610f4a2713aSLionel Sambuc   DW_LANG_ObjC = 0x0010,
611f4a2713aSLionel Sambuc   DW_LANG_ObjC_plus_plus = 0x0011,
612f4a2713aSLionel Sambuc   DW_LANG_UPC = 0x0012,
613f4a2713aSLionel Sambuc   DW_LANG_D = 0x0013,
614*0a6a1f1dSLionel Sambuc   // New in DWARF 5:
615f4a2713aSLionel Sambuc   DW_LANG_Python = 0x0014,
616*0a6a1f1dSLionel Sambuc   DW_LANG_OpenCL = 0x0015,
617*0a6a1f1dSLionel Sambuc   DW_LANG_Go = 0x0016,
618*0a6a1f1dSLionel Sambuc   DW_LANG_Modula3 = 0x0017,
619*0a6a1f1dSLionel Sambuc   DW_LANG_Haskell = 0x0018,
620*0a6a1f1dSLionel Sambuc   DW_LANG_C_plus_plus_03 = 0x0019,
621*0a6a1f1dSLionel Sambuc   DW_LANG_C_plus_plus_11 = 0x001a,
622*0a6a1f1dSLionel Sambuc   DW_LANG_OCaml = 0x001b,
623*0a6a1f1dSLionel Sambuc 
624f4a2713aSLionel Sambuc   DW_LANG_lo_user = 0x8000,
625f4a2713aSLionel Sambuc   DW_LANG_Mips_Assembler = 0x8001,
626f4a2713aSLionel Sambuc   DW_LANG_hi_user = 0xffff
627f4a2713aSLionel Sambuc };
628f4a2713aSLionel Sambuc 
629f4a2713aSLionel Sambuc enum CaseSensitivity {
630f4a2713aSLionel Sambuc   // Identifier case codes
631f4a2713aSLionel Sambuc   DW_ID_case_sensitive = 0x00,
632f4a2713aSLionel Sambuc   DW_ID_up_case = 0x01,
633f4a2713aSLionel Sambuc   DW_ID_down_case = 0x02,
634f4a2713aSLionel Sambuc   DW_ID_case_insensitive = 0x03
635f4a2713aSLionel Sambuc };
636f4a2713aSLionel Sambuc 
637f4a2713aSLionel Sambuc enum CallingConvention {
638f4a2713aSLionel Sambuc   // Calling convention codes
639f4a2713aSLionel Sambuc   DW_CC_normal = 0x01,
640f4a2713aSLionel Sambuc   DW_CC_program = 0x02,
641f4a2713aSLionel Sambuc   DW_CC_nocall = 0x03,
642f4a2713aSLionel Sambuc   DW_CC_lo_user = 0x40,
643f4a2713aSLionel Sambuc   DW_CC_hi_user = 0xff
644f4a2713aSLionel Sambuc };
645f4a2713aSLionel Sambuc 
646f4a2713aSLionel Sambuc enum InlineAttribute {
647f4a2713aSLionel Sambuc   // Inline codes
648f4a2713aSLionel Sambuc   DW_INL_not_inlined = 0x00,
649f4a2713aSLionel Sambuc   DW_INL_inlined = 0x01,
650f4a2713aSLionel Sambuc   DW_INL_declared_not_inlined = 0x02,
651f4a2713aSLionel Sambuc   DW_INL_declared_inlined = 0x03
652f4a2713aSLionel Sambuc };
653f4a2713aSLionel Sambuc 
654f4a2713aSLionel Sambuc enum ArrayDimensionOrdering {
655f4a2713aSLionel Sambuc   // Array ordering
656f4a2713aSLionel Sambuc   DW_ORD_row_major = 0x00,
657f4a2713aSLionel Sambuc   DW_ORD_col_major = 0x01
658f4a2713aSLionel Sambuc };
659f4a2713aSLionel Sambuc 
660f4a2713aSLionel Sambuc enum DiscriminantList {
661f4a2713aSLionel Sambuc   // Discriminant descriptor values
662f4a2713aSLionel Sambuc   DW_DSC_label = 0x00,
663f4a2713aSLionel Sambuc   DW_DSC_range = 0x01
664f4a2713aSLionel Sambuc };
665f4a2713aSLionel Sambuc 
666f4a2713aSLionel Sambuc enum LineNumberOps {
667f4a2713aSLionel Sambuc   // Line Number Standard Opcode Encodings
668f4a2713aSLionel Sambuc   DW_LNS_extended_op = 0x00,
669f4a2713aSLionel Sambuc   DW_LNS_copy = 0x01,
670f4a2713aSLionel Sambuc   DW_LNS_advance_pc = 0x02,
671f4a2713aSLionel Sambuc   DW_LNS_advance_line = 0x03,
672f4a2713aSLionel Sambuc   DW_LNS_set_file = 0x04,
673f4a2713aSLionel Sambuc   DW_LNS_set_column = 0x05,
674f4a2713aSLionel Sambuc   DW_LNS_negate_stmt = 0x06,
675f4a2713aSLionel Sambuc   DW_LNS_set_basic_block = 0x07,
676f4a2713aSLionel Sambuc   DW_LNS_const_add_pc = 0x08,
677f4a2713aSLionel Sambuc   DW_LNS_fixed_advance_pc = 0x09,
678f4a2713aSLionel Sambuc   DW_LNS_set_prologue_end = 0x0a,
679f4a2713aSLionel Sambuc   DW_LNS_set_epilogue_begin = 0x0b,
680f4a2713aSLionel Sambuc   DW_LNS_set_isa = 0x0c
681f4a2713aSLionel Sambuc };
682f4a2713aSLionel Sambuc 
683f4a2713aSLionel Sambuc enum LineNumberExtendedOps {
684f4a2713aSLionel Sambuc   // Line Number Extended Opcode Encodings
685f4a2713aSLionel Sambuc   DW_LNE_end_sequence = 0x01,
686f4a2713aSLionel Sambuc   DW_LNE_set_address = 0x02,
687f4a2713aSLionel Sambuc   DW_LNE_define_file = 0x03,
688f4a2713aSLionel Sambuc   DW_LNE_set_discriminator = 0x04,
689f4a2713aSLionel Sambuc   DW_LNE_lo_user = 0x80,
690f4a2713aSLionel Sambuc   DW_LNE_hi_user = 0xff
691f4a2713aSLionel Sambuc };
692f4a2713aSLionel Sambuc 
693f4a2713aSLionel Sambuc enum MacinfoRecordType {
694f4a2713aSLionel Sambuc   // Macinfo Type Encodings
695f4a2713aSLionel Sambuc   DW_MACINFO_define = 0x01,
696f4a2713aSLionel Sambuc   DW_MACINFO_undef = 0x02,
697f4a2713aSLionel Sambuc   DW_MACINFO_start_file = 0x03,
698f4a2713aSLionel Sambuc   DW_MACINFO_end_file = 0x04,
699f4a2713aSLionel Sambuc   DW_MACINFO_vendor_ext = 0xff
700f4a2713aSLionel Sambuc };
701f4a2713aSLionel Sambuc 
702f4a2713aSLionel Sambuc enum CallFrameInfo {
703f4a2713aSLionel Sambuc   // Call frame instruction encodings
704f4a2713aSLionel Sambuc   DW_CFA_extended = 0x00,
705f4a2713aSLionel Sambuc   DW_CFA_nop = 0x00,
706f4a2713aSLionel Sambuc   DW_CFA_advance_loc = 0x40,
707f4a2713aSLionel Sambuc   DW_CFA_offset = 0x80,
708f4a2713aSLionel Sambuc   DW_CFA_restore = 0xc0,
709f4a2713aSLionel Sambuc   DW_CFA_set_loc = 0x01,
710f4a2713aSLionel Sambuc   DW_CFA_advance_loc1 = 0x02,
711f4a2713aSLionel Sambuc   DW_CFA_advance_loc2 = 0x03,
712f4a2713aSLionel Sambuc   DW_CFA_advance_loc4 = 0x04,
713f4a2713aSLionel Sambuc   DW_CFA_offset_extended = 0x05,
714f4a2713aSLionel Sambuc   DW_CFA_restore_extended = 0x06,
715f4a2713aSLionel Sambuc   DW_CFA_undefined = 0x07,
716f4a2713aSLionel Sambuc   DW_CFA_same_value = 0x08,
717f4a2713aSLionel Sambuc   DW_CFA_register = 0x09,
718f4a2713aSLionel Sambuc   DW_CFA_remember_state = 0x0a,
719f4a2713aSLionel Sambuc   DW_CFA_restore_state = 0x0b,
720f4a2713aSLionel Sambuc   DW_CFA_def_cfa = 0x0c,
721f4a2713aSLionel Sambuc   DW_CFA_def_cfa_register = 0x0d,
722f4a2713aSLionel Sambuc   DW_CFA_def_cfa_offset = 0x0e,
723f4a2713aSLionel Sambuc   DW_CFA_def_cfa_expression = 0x0f,
724f4a2713aSLionel Sambuc   DW_CFA_expression = 0x10,
725f4a2713aSLionel Sambuc   DW_CFA_offset_extended_sf = 0x11,
726f4a2713aSLionel Sambuc   DW_CFA_def_cfa_sf = 0x12,
727f4a2713aSLionel Sambuc   DW_CFA_def_cfa_offset_sf = 0x13,
728f4a2713aSLionel Sambuc   DW_CFA_val_offset = 0x14,
729f4a2713aSLionel Sambuc   DW_CFA_val_offset_sf = 0x15,
730f4a2713aSLionel Sambuc   DW_CFA_val_expression = 0x16,
731f4a2713aSLionel Sambuc   DW_CFA_MIPS_advance_loc8 = 0x1d,
732f4a2713aSLionel Sambuc   DW_CFA_GNU_window_save = 0x2d,
733f4a2713aSLionel Sambuc   DW_CFA_GNU_args_size = 0x2e,
734f4a2713aSLionel Sambuc   DW_CFA_lo_user = 0x1c,
735f4a2713aSLionel Sambuc   DW_CFA_hi_user = 0x3f
736f4a2713aSLionel Sambuc };
737f4a2713aSLionel Sambuc 
738f4a2713aSLionel Sambuc enum Constants {
739f4a2713aSLionel Sambuc   // Children flag
740f4a2713aSLionel Sambuc   DW_CHILDREN_no = 0x00,
741f4a2713aSLionel Sambuc   DW_CHILDREN_yes = 0x01,
742f4a2713aSLionel Sambuc 
743f4a2713aSLionel Sambuc   DW_EH_PE_absptr = 0x00,
744f4a2713aSLionel Sambuc   DW_EH_PE_omit = 0xff,
745f4a2713aSLionel Sambuc   DW_EH_PE_uleb128 = 0x01,
746f4a2713aSLionel Sambuc   DW_EH_PE_udata2 = 0x02,
747f4a2713aSLionel Sambuc   DW_EH_PE_udata4 = 0x03,
748f4a2713aSLionel Sambuc   DW_EH_PE_udata8 = 0x04,
749f4a2713aSLionel Sambuc   DW_EH_PE_sleb128 = 0x09,
750f4a2713aSLionel Sambuc   DW_EH_PE_sdata2 = 0x0A,
751f4a2713aSLionel Sambuc   DW_EH_PE_sdata4 = 0x0B,
752f4a2713aSLionel Sambuc   DW_EH_PE_sdata8 = 0x0C,
753f4a2713aSLionel Sambuc   DW_EH_PE_signed = 0x08,
754f4a2713aSLionel Sambuc   DW_EH_PE_pcrel = 0x10,
755f4a2713aSLionel Sambuc   DW_EH_PE_textrel = 0x20,
756f4a2713aSLionel Sambuc   DW_EH_PE_datarel = 0x30,
757f4a2713aSLionel Sambuc   DW_EH_PE_funcrel = 0x40,
758f4a2713aSLionel Sambuc   DW_EH_PE_aligned = 0x50,
759f4a2713aSLionel Sambuc   DW_EH_PE_indirect = 0x80
760f4a2713aSLionel Sambuc };
761f4a2713aSLionel Sambuc 
762*0a6a1f1dSLionel Sambuc // Constants for debug_loc.dwo in the DWARF5 Split Debug Info Proposal
763*0a6a1f1dSLionel Sambuc enum LocationListEntry : unsigned char {
764*0a6a1f1dSLionel Sambuc   DW_LLE_end_of_list_entry,
765*0a6a1f1dSLionel Sambuc   DW_LLE_base_address_selection_entry,
766*0a6a1f1dSLionel Sambuc   DW_LLE_start_end_entry,
767*0a6a1f1dSLionel Sambuc   DW_LLE_start_length_entry,
768*0a6a1f1dSLionel Sambuc   DW_LLE_offset_pair_entry
769*0a6a1f1dSLionel Sambuc };
770*0a6a1f1dSLionel Sambuc 
771*0a6a1f1dSLionel Sambuc /// Contstants for the DW_APPLE_PROPERTY_attributes attribute.
772*0a6a1f1dSLionel Sambuc /// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind.
773f4a2713aSLionel Sambuc enum ApplePropertyAttributes {
774f4a2713aSLionel Sambuc   // Apple Objective-C Property Attributes
775f4a2713aSLionel Sambuc   DW_APPLE_PROPERTY_readonly = 0x01,
776*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_getter = 0x02,
777f4a2713aSLionel Sambuc   DW_APPLE_PROPERTY_assign = 0x04,
778*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_readwrite = 0x08,
779*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_retain = 0x10,
780*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_copy = 0x20,
781*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_nonatomic = 0x40,
782*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_setter = 0x80,
783*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_atomic = 0x100,
784*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_weak =   0x200,
785*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_strong = 0x400,
786*0a6a1f1dSLionel Sambuc   DW_APPLE_PROPERTY_unsafe_unretained = 0x800
787f4a2713aSLionel Sambuc };
788f4a2713aSLionel Sambuc 
789f4a2713aSLionel Sambuc // Constants for the DWARF5 Accelerator Table Proposal
790f4a2713aSLionel Sambuc enum AcceleratorTable {
791f4a2713aSLionel Sambuc   // Data layout descriptors.
792f4a2713aSLionel Sambuc   DW_ATOM_null = 0u,       // Marker as the end of a list of atoms.
793f4a2713aSLionel Sambuc   DW_ATOM_die_offset = 1u, // DIE offset in the debug_info section.
794f4a2713aSLionel Sambuc   DW_ATOM_cu_offset = 2u, // Offset of the compile unit header that contains the
795f4a2713aSLionel Sambuc                           // item in question.
796f4a2713aSLionel Sambuc   DW_ATOM_die_tag = 3u,   // A tag entry.
797f4a2713aSLionel Sambuc   DW_ATOM_type_flags = 4u, // Set of flags for a type.
798f4a2713aSLionel Sambuc 
799f4a2713aSLionel Sambuc   // DW_ATOM_type_flags values.
800f4a2713aSLionel Sambuc 
801f4a2713aSLionel Sambuc   // Always set for C++, only set for ObjC if this is the @implementation for a
802f4a2713aSLionel Sambuc   // class.
803f4a2713aSLionel Sambuc   DW_FLAG_type_implementation = 2u,
804f4a2713aSLionel Sambuc 
805f4a2713aSLionel Sambuc   // Hash functions.
806f4a2713aSLionel Sambuc 
807f4a2713aSLionel Sambuc   // Daniel J. Bernstein hash.
808f4a2713aSLionel Sambuc   DW_hash_function_djb = 0u
809f4a2713aSLionel Sambuc };
810f4a2713aSLionel Sambuc 
811f4a2713aSLionel Sambuc // Constants for the GNU pubnames/pubtypes extensions supporting gdb index.
812f4a2713aSLionel Sambuc enum GDBIndexEntryKind {
813f4a2713aSLionel Sambuc   GIEK_NONE,
814f4a2713aSLionel Sambuc   GIEK_TYPE,
815f4a2713aSLionel Sambuc   GIEK_VARIABLE,
816f4a2713aSLionel Sambuc   GIEK_FUNCTION,
817f4a2713aSLionel Sambuc   GIEK_OTHER,
818f4a2713aSLionel Sambuc   GIEK_UNUSED5,
819f4a2713aSLionel Sambuc   GIEK_UNUSED6,
820f4a2713aSLionel Sambuc   GIEK_UNUSED7
821f4a2713aSLionel Sambuc };
822f4a2713aSLionel Sambuc 
823f4a2713aSLionel Sambuc enum GDBIndexEntryLinkage {
824f4a2713aSLionel Sambuc   GIEL_EXTERNAL,
825f4a2713aSLionel Sambuc   GIEL_STATIC
826f4a2713aSLionel Sambuc };
827f4a2713aSLionel Sambuc 
828*0a6a1f1dSLionel Sambuc /// \defgroup DwarfConstantsDumping Dwarf constants dumping functions
829*0a6a1f1dSLionel Sambuc ///
830*0a6a1f1dSLionel Sambuc /// All these functions map their argument's value back to the
831*0a6a1f1dSLionel Sambuc /// corresponding enumerator name or return nullptr if the value isn't
832*0a6a1f1dSLionel Sambuc /// known.
833*0a6a1f1dSLionel Sambuc ///
834*0a6a1f1dSLionel Sambuc /// @{
835*0a6a1f1dSLionel Sambuc const char *TagString(unsigned Tag);
836*0a6a1f1dSLionel Sambuc const char *ChildrenString(unsigned Children);
837*0a6a1f1dSLionel Sambuc const char *AttributeString(unsigned Attribute);
838*0a6a1f1dSLionel Sambuc const char *FormEncodingString(unsigned Encoding);
839*0a6a1f1dSLionel Sambuc const char *OperationEncodingString(unsigned Encoding);
840*0a6a1f1dSLionel Sambuc const char *AttributeEncodingString(unsigned Encoding);
841*0a6a1f1dSLionel Sambuc const char *DecimalSignString(unsigned Sign);
842*0a6a1f1dSLionel Sambuc const char *EndianityString(unsigned Endian);
843*0a6a1f1dSLionel Sambuc const char *AccessibilityString(unsigned Access);
844*0a6a1f1dSLionel Sambuc const char *VisibilityString(unsigned Visibility);
845*0a6a1f1dSLionel Sambuc const char *VirtualityString(unsigned Virtuality);
846*0a6a1f1dSLionel Sambuc const char *LanguageString(unsigned Language);
847*0a6a1f1dSLionel Sambuc const char *CaseString(unsigned Case);
848*0a6a1f1dSLionel Sambuc const char *ConventionString(unsigned Convention);
849*0a6a1f1dSLionel Sambuc const char *InlineCodeString(unsigned Code);
850*0a6a1f1dSLionel Sambuc const char *ArrayOrderString(unsigned Order);
851*0a6a1f1dSLionel Sambuc const char *DiscriminantString(unsigned Discriminant);
852*0a6a1f1dSLionel Sambuc const char *LNStandardString(unsigned Standard);
853*0a6a1f1dSLionel Sambuc const char *LNExtendedString(unsigned Encoding);
854*0a6a1f1dSLionel Sambuc const char *MacinfoString(unsigned Encoding);
855*0a6a1f1dSLionel Sambuc const char *CallFrameString(unsigned Encoding);
856*0a6a1f1dSLionel Sambuc const char *ApplePropertyString(unsigned);
857*0a6a1f1dSLionel Sambuc const char *AtomTypeString(unsigned Atom);
858*0a6a1f1dSLionel Sambuc const char *GDBIndexEntryKindString(GDBIndexEntryKind Kind);
859f4a2713aSLionel Sambuc const char *GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
860*0a6a1f1dSLionel Sambuc /// @}
861f4a2713aSLionel Sambuc 
862*0a6a1f1dSLionel Sambuc /// \brief Returns the symbolic string representing Val when used as a value
863*0a6a1f1dSLionel Sambuc /// for attribute Attr.
864*0a6a1f1dSLionel Sambuc const char *AttributeValueString(uint16_t Attr, unsigned Val);
865*0a6a1f1dSLionel Sambuc 
866*0a6a1f1dSLionel Sambuc /// \brief Decsribes an entry of the various gnu_pub* debug sections.
867*0a6a1f1dSLionel Sambuc ///
868f4a2713aSLionel Sambuc /// The gnu_pub* kind looks like:
869f4a2713aSLionel Sambuc ///
870f4a2713aSLionel Sambuc /// 0-3  reserved
871f4a2713aSLionel Sambuc /// 4-6  symbol kind
872f4a2713aSLionel Sambuc /// 7    0 == global, 1 == static
873f4a2713aSLionel Sambuc ///
874f4a2713aSLionel Sambuc /// A gdb_index descriptor includes the above kind, shifted 24 bits up with the
875f4a2713aSLionel Sambuc /// offset of the cu within the debug_info section stored in those 24 bits.
876f4a2713aSLionel Sambuc struct PubIndexEntryDescriptor {
877f4a2713aSLionel Sambuc   GDBIndexEntryKind Kind;
878f4a2713aSLionel Sambuc   GDBIndexEntryLinkage Linkage;
PubIndexEntryDescriptorPubIndexEntryDescriptor879f4a2713aSLionel Sambuc   PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
880f4a2713aSLionel Sambuc       : Kind(Kind), Linkage(Linkage) {}
PubIndexEntryDescriptorPubIndexEntryDescriptor881f4a2713aSLionel Sambuc   /* implicit */ PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
882f4a2713aSLionel Sambuc       : Kind(Kind), Linkage(GIEL_EXTERNAL) {}
PubIndexEntryDescriptorPubIndexEntryDescriptor883f4a2713aSLionel Sambuc   explicit PubIndexEntryDescriptor(uint8_t Value)
884f4a2713aSLionel Sambuc       : Kind(static_cast<GDBIndexEntryKind>((Value & KIND_MASK) >>
885f4a2713aSLionel Sambuc                                             KIND_OFFSET)),
886f4a2713aSLionel Sambuc         Linkage(static_cast<GDBIndexEntryLinkage>((Value & LINKAGE_MASK) >>
887f4a2713aSLionel Sambuc                                                   LINKAGE_OFFSET)) {}
toBitsPubIndexEntryDescriptor888f4a2713aSLionel Sambuc   uint8_t toBits() { return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET; }
889f4a2713aSLionel Sambuc 
890f4a2713aSLionel Sambuc private:
891f4a2713aSLionel Sambuc   enum {
892f4a2713aSLionel Sambuc     KIND_OFFSET = 4,
893f4a2713aSLionel Sambuc     KIND_MASK = 7 << KIND_OFFSET,
894f4a2713aSLionel Sambuc     LINKAGE_OFFSET = 7,
895f4a2713aSLionel Sambuc     LINKAGE_MASK = 1 << LINKAGE_OFFSET
896f4a2713aSLionel Sambuc   };
897f4a2713aSLionel Sambuc };
898f4a2713aSLionel Sambuc 
899*0a6a1f1dSLionel Sambuc 
900f4a2713aSLionel Sambuc } // End of namespace dwarf
901f4a2713aSLionel Sambuc 
902f4a2713aSLionel Sambuc } // End of namespace llvm
903f4a2713aSLionel Sambuc 
904f4a2713aSLionel Sambuc #endif
905