1*9880d681SAndroid Build Coastguard Worker //===-- llvm/Support/Dwarf.cpp - Dwarf Framework ----------------*- C++ -*-===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file contains support for generic dwarf information.
11*9880d681SAndroid Build Coastguard Worker //
12*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.h"
15*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/StringSwitch.h"
16*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/ErrorHandling.h"
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker using namespace llvm;
19*9880d681SAndroid Build Coastguard Worker using namespace dwarf;
20*9880d681SAndroid Build Coastguard Worker
TagString(unsigned Tag)21*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::TagString(unsigned Tag) {
22*9880d681SAndroid Build Coastguard Worker switch (Tag) {
23*9880d681SAndroid Build Coastguard Worker default: return nullptr;
24*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_TAG(ID, NAME) \
25*9880d681SAndroid Build Coastguard Worker case DW_TAG_##NAME: \
26*9880d681SAndroid Build Coastguard Worker return "DW_TAG_" #NAME;
27*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
28*9880d681SAndroid Build Coastguard Worker }
29*9880d681SAndroid Build Coastguard Worker }
30*9880d681SAndroid Build Coastguard Worker
getTag(StringRef TagString)31*9880d681SAndroid Build Coastguard Worker unsigned llvm::dwarf::getTag(StringRef TagString) {
32*9880d681SAndroid Build Coastguard Worker return StringSwitch<unsigned>(TagString)
33*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_TAG(ID, NAME) .Case("DW_TAG_" #NAME, DW_TAG_##NAME)
34*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
35*9880d681SAndroid Build Coastguard Worker .Default(DW_TAG_invalid);
36*9880d681SAndroid Build Coastguard Worker }
37*9880d681SAndroid Build Coastguard Worker
ChildrenString(unsigned Children)38*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::ChildrenString(unsigned Children) {
39*9880d681SAndroid Build Coastguard Worker switch (Children) {
40*9880d681SAndroid Build Coastguard Worker case DW_CHILDREN_no: return "DW_CHILDREN_no";
41*9880d681SAndroid Build Coastguard Worker case DW_CHILDREN_yes: return "DW_CHILDREN_yes";
42*9880d681SAndroid Build Coastguard Worker }
43*9880d681SAndroid Build Coastguard Worker return nullptr;
44*9880d681SAndroid Build Coastguard Worker }
45*9880d681SAndroid Build Coastguard Worker
AttributeString(unsigned Attribute)46*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::AttributeString(unsigned Attribute) {
47*9880d681SAndroid Build Coastguard Worker switch (Attribute) {
48*9880d681SAndroid Build Coastguard Worker case DW_AT_sibling: return "DW_AT_sibling";
49*9880d681SAndroid Build Coastguard Worker case DW_AT_location: return "DW_AT_location";
50*9880d681SAndroid Build Coastguard Worker case DW_AT_name: return "DW_AT_name";
51*9880d681SAndroid Build Coastguard Worker case DW_AT_ordering: return "DW_AT_ordering";
52*9880d681SAndroid Build Coastguard Worker case DW_AT_byte_size: return "DW_AT_byte_size";
53*9880d681SAndroid Build Coastguard Worker case DW_AT_bit_offset: return "DW_AT_bit_offset";
54*9880d681SAndroid Build Coastguard Worker case DW_AT_bit_size: return "DW_AT_bit_size";
55*9880d681SAndroid Build Coastguard Worker case DW_AT_stmt_list: return "DW_AT_stmt_list";
56*9880d681SAndroid Build Coastguard Worker case DW_AT_low_pc: return "DW_AT_low_pc";
57*9880d681SAndroid Build Coastguard Worker case DW_AT_high_pc: return "DW_AT_high_pc";
58*9880d681SAndroid Build Coastguard Worker case DW_AT_language: return "DW_AT_language";
59*9880d681SAndroid Build Coastguard Worker case DW_AT_discr: return "DW_AT_discr";
60*9880d681SAndroid Build Coastguard Worker case DW_AT_discr_value: return "DW_AT_discr_value";
61*9880d681SAndroid Build Coastguard Worker case DW_AT_visibility: return "DW_AT_visibility";
62*9880d681SAndroid Build Coastguard Worker case DW_AT_import: return "DW_AT_import";
63*9880d681SAndroid Build Coastguard Worker case DW_AT_string_length: return "DW_AT_string_length";
64*9880d681SAndroid Build Coastguard Worker case DW_AT_common_reference: return "DW_AT_common_reference";
65*9880d681SAndroid Build Coastguard Worker case DW_AT_comp_dir: return "DW_AT_comp_dir";
66*9880d681SAndroid Build Coastguard Worker case DW_AT_const_value: return "DW_AT_const_value";
67*9880d681SAndroid Build Coastguard Worker case DW_AT_containing_type: return "DW_AT_containing_type";
68*9880d681SAndroid Build Coastguard Worker case DW_AT_default_value: return "DW_AT_default_value";
69*9880d681SAndroid Build Coastguard Worker case DW_AT_inline: return "DW_AT_inline";
70*9880d681SAndroid Build Coastguard Worker case DW_AT_is_optional: return "DW_AT_is_optional";
71*9880d681SAndroid Build Coastguard Worker case DW_AT_lower_bound: return "DW_AT_lower_bound";
72*9880d681SAndroid Build Coastguard Worker case DW_AT_producer: return "DW_AT_producer";
73*9880d681SAndroid Build Coastguard Worker case DW_AT_prototyped: return "DW_AT_prototyped";
74*9880d681SAndroid Build Coastguard Worker case DW_AT_return_addr: return "DW_AT_return_addr";
75*9880d681SAndroid Build Coastguard Worker case DW_AT_start_scope: return "DW_AT_start_scope";
76*9880d681SAndroid Build Coastguard Worker case DW_AT_bit_stride: return "DW_AT_bit_stride";
77*9880d681SAndroid Build Coastguard Worker case DW_AT_upper_bound: return "DW_AT_upper_bound";
78*9880d681SAndroid Build Coastguard Worker case DW_AT_abstract_origin: return "DW_AT_abstract_origin";
79*9880d681SAndroid Build Coastguard Worker case DW_AT_accessibility: return "DW_AT_accessibility";
80*9880d681SAndroid Build Coastguard Worker case DW_AT_address_class: return "DW_AT_address_class";
81*9880d681SAndroid Build Coastguard Worker case DW_AT_artificial: return "DW_AT_artificial";
82*9880d681SAndroid Build Coastguard Worker case DW_AT_base_types: return "DW_AT_base_types";
83*9880d681SAndroid Build Coastguard Worker case DW_AT_calling_convention: return "DW_AT_calling_convention";
84*9880d681SAndroid Build Coastguard Worker case DW_AT_count: return "DW_AT_count";
85*9880d681SAndroid Build Coastguard Worker case DW_AT_data_member_location: return "DW_AT_data_member_location";
86*9880d681SAndroid Build Coastguard Worker case DW_AT_decl_column: return "DW_AT_decl_column";
87*9880d681SAndroid Build Coastguard Worker case DW_AT_decl_file: return "DW_AT_decl_file";
88*9880d681SAndroid Build Coastguard Worker case DW_AT_decl_line: return "DW_AT_decl_line";
89*9880d681SAndroid Build Coastguard Worker case DW_AT_declaration: return "DW_AT_declaration";
90*9880d681SAndroid Build Coastguard Worker case DW_AT_discr_list: return "DW_AT_discr_list";
91*9880d681SAndroid Build Coastguard Worker case DW_AT_encoding: return "DW_AT_encoding";
92*9880d681SAndroid Build Coastguard Worker case DW_AT_external: return "DW_AT_external";
93*9880d681SAndroid Build Coastguard Worker case DW_AT_frame_base: return "DW_AT_frame_base";
94*9880d681SAndroid Build Coastguard Worker case DW_AT_friend: return "DW_AT_friend";
95*9880d681SAndroid Build Coastguard Worker case DW_AT_identifier_case: return "DW_AT_identifier_case";
96*9880d681SAndroid Build Coastguard Worker case DW_AT_macro_info: return "DW_AT_macro_info";
97*9880d681SAndroid Build Coastguard Worker case DW_AT_namelist_item: return "DW_AT_namelist_item";
98*9880d681SAndroid Build Coastguard Worker case DW_AT_priority: return "DW_AT_priority";
99*9880d681SAndroid Build Coastguard Worker case DW_AT_segment: return "DW_AT_segment";
100*9880d681SAndroid Build Coastguard Worker case DW_AT_specification: return "DW_AT_specification";
101*9880d681SAndroid Build Coastguard Worker case DW_AT_static_link: return "DW_AT_static_link";
102*9880d681SAndroid Build Coastguard Worker case DW_AT_type: return "DW_AT_type";
103*9880d681SAndroid Build Coastguard Worker case DW_AT_use_location: return "DW_AT_use_location";
104*9880d681SAndroid Build Coastguard Worker case DW_AT_variable_parameter: return "DW_AT_variable_parameter";
105*9880d681SAndroid Build Coastguard Worker case DW_AT_virtuality: return "DW_AT_virtuality";
106*9880d681SAndroid Build Coastguard Worker case DW_AT_vtable_elem_location: return "DW_AT_vtable_elem_location";
107*9880d681SAndroid Build Coastguard Worker case DW_AT_allocated: return "DW_AT_allocated";
108*9880d681SAndroid Build Coastguard Worker case DW_AT_associated: return "DW_AT_associated";
109*9880d681SAndroid Build Coastguard Worker case DW_AT_data_location: return "DW_AT_data_location";
110*9880d681SAndroid Build Coastguard Worker case DW_AT_byte_stride: return "DW_AT_byte_stride";
111*9880d681SAndroid Build Coastguard Worker case DW_AT_entry_pc: return "DW_AT_entry_pc";
112*9880d681SAndroid Build Coastguard Worker case DW_AT_use_UTF8: return "DW_AT_use_UTF8";
113*9880d681SAndroid Build Coastguard Worker case DW_AT_extension: return "DW_AT_extension";
114*9880d681SAndroid Build Coastguard Worker case DW_AT_ranges: return "DW_AT_ranges";
115*9880d681SAndroid Build Coastguard Worker case DW_AT_trampoline: return "DW_AT_trampoline";
116*9880d681SAndroid Build Coastguard Worker case DW_AT_call_column: return "DW_AT_call_column";
117*9880d681SAndroid Build Coastguard Worker case DW_AT_call_file: return "DW_AT_call_file";
118*9880d681SAndroid Build Coastguard Worker case DW_AT_call_line: return "DW_AT_call_line";
119*9880d681SAndroid Build Coastguard Worker case DW_AT_description: return "DW_AT_description";
120*9880d681SAndroid Build Coastguard Worker case DW_AT_binary_scale: return "DW_AT_binary_scale";
121*9880d681SAndroid Build Coastguard Worker case DW_AT_decimal_scale: return "DW_AT_decimal_scale";
122*9880d681SAndroid Build Coastguard Worker case DW_AT_small: return "DW_AT_small";
123*9880d681SAndroid Build Coastguard Worker case DW_AT_decimal_sign: return "DW_AT_decimal_sign";
124*9880d681SAndroid Build Coastguard Worker case DW_AT_digit_count: return "DW_AT_digit_count";
125*9880d681SAndroid Build Coastguard Worker case DW_AT_picture_string: return "DW_AT_picture_string";
126*9880d681SAndroid Build Coastguard Worker case DW_AT_mutable: return "DW_AT_mutable";
127*9880d681SAndroid Build Coastguard Worker case DW_AT_threads_scaled: return "DW_AT_threads_scaled";
128*9880d681SAndroid Build Coastguard Worker case DW_AT_explicit: return "DW_AT_explicit";
129*9880d681SAndroid Build Coastguard Worker case DW_AT_object_pointer: return "DW_AT_object_pointer";
130*9880d681SAndroid Build Coastguard Worker case DW_AT_endianity: return "DW_AT_endianity";
131*9880d681SAndroid Build Coastguard Worker case DW_AT_elemental: return "DW_AT_elemental";
132*9880d681SAndroid Build Coastguard Worker case DW_AT_pure: return "DW_AT_pure";
133*9880d681SAndroid Build Coastguard Worker case DW_AT_recursive: return "DW_AT_recursive";
134*9880d681SAndroid Build Coastguard Worker case DW_AT_signature: return "DW_AT_signature";
135*9880d681SAndroid Build Coastguard Worker case DW_AT_main_subprogram: return "DW_AT_main_subprogram";
136*9880d681SAndroid Build Coastguard Worker case DW_AT_data_bit_offset: return "DW_AT_data_bit_offset";
137*9880d681SAndroid Build Coastguard Worker case DW_AT_const_expr: return "DW_AT_const_expr";
138*9880d681SAndroid Build Coastguard Worker case DW_AT_enum_class: return "DW_AT_enum_class";
139*9880d681SAndroid Build Coastguard Worker case DW_AT_linkage_name: return "DW_AT_linkage_name";
140*9880d681SAndroid Build Coastguard Worker case DW_AT_string_length_bit_size: return "DW_AT_string_length_bit_size";
141*9880d681SAndroid Build Coastguard Worker case DW_AT_string_length_byte_size: return "DW_AT_string_length_byte_size";
142*9880d681SAndroid Build Coastguard Worker case DW_AT_rank: return "DW_AT_rank";
143*9880d681SAndroid Build Coastguard Worker case DW_AT_str_offsets_base: return "DW_AT_str_offsets_base";
144*9880d681SAndroid Build Coastguard Worker case DW_AT_addr_base: return "DW_AT_addr_base";
145*9880d681SAndroid Build Coastguard Worker case DW_AT_ranges_base: return "DW_AT_ranges_base";
146*9880d681SAndroid Build Coastguard Worker case DW_AT_dwo_id: return "DW_AT_dwo_id";
147*9880d681SAndroid Build Coastguard Worker case DW_AT_dwo_name: return "DW_AT_dwo_name";
148*9880d681SAndroid Build Coastguard Worker case DW_AT_reference: return "DW_AT_reference";
149*9880d681SAndroid Build Coastguard Worker case DW_AT_rvalue_reference: return "DW_AT_rvalue_reference";
150*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_loop_begin: return "DW_AT_MIPS_loop_begin";
151*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_tail_loop_begin: return "DW_AT_MIPS_tail_loop_begin";
152*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_epilog_begin: return "DW_AT_MIPS_epilog_begin";
153*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_loop_unroll_factor: return "DW_AT_MIPS_loop_unroll_factor";
154*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_software_pipeline_depth:
155*9880d681SAndroid Build Coastguard Worker return "DW_AT_MIPS_software_pipeline_depth";
156*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_linkage_name: return "DW_AT_MIPS_linkage_name";
157*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_stride: return "DW_AT_MIPS_stride";
158*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_abstract_name: return "DW_AT_MIPS_abstract_name";
159*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_clone_origin: return "DW_AT_MIPS_clone_origin";
160*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_has_inlines: return "DW_AT_MIPS_has_inlines";
161*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_stride_byte: return "DW_AT_MIPS_stride_byte";
162*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_stride_elem: return "DW_AT_MIPS_stride_elem";
163*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_ptr_dopetype: return "DW_AT_MIPS_ptr_dopetype";
164*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_allocatable_dopetype:
165*9880d681SAndroid Build Coastguard Worker return "DW_AT_MIPS_allocatable_dopetype";
166*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_assumed_shape_dopetype:
167*9880d681SAndroid Build Coastguard Worker return "DW_AT_MIPS_assumed_shape_dopetype";
168*9880d681SAndroid Build Coastguard Worker case DW_AT_sf_names: return "DW_AT_sf_names";
169*9880d681SAndroid Build Coastguard Worker case DW_AT_src_info: return "DW_AT_src_info";
170*9880d681SAndroid Build Coastguard Worker case DW_AT_mac_info: return "DW_AT_mac_info";
171*9880d681SAndroid Build Coastguard Worker case DW_AT_src_coords: return "DW_AT_src_coords";
172*9880d681SAndroid Build Coastguard Worker case DW_AT_body_begin: return "DW_AT_body_begin";
173*9880d681SAndroid Build Coastguard Worker case DW_AT_body_end: return "DW_AT_body_end";
174*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_vector: return "DW_AT_GNU_vector";
175*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_template_name: return "DW_AT_GNU_template_name";
176*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_odr_signature: return "DW_AT_GNU_odr_signature";
177*9880d681SAndroid Build Coastguard Worker case DW_AT_MIPS_assumed_size: return "DW_AT_MIPS_assumed_size";
178*9880d681SAndroid Build Coastguard Worker case DW_AT_lo_user: return "DW_AT_lo_user";
179*9880d681SAndroid Build Coastguard Worker case DW_AT_hi_user: return "DW_AT_hi_user";
180*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_property_read: return "DW_AT_BORLAND_property_read";
181*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_property_write: return "DW_AT_BORLAND_property_write";
182*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_property_implements: return "DW_AT_BORLAND_property_implements";
183*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_property_index: return "DW_AT_BORLAND_property_index";
184*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_property_default: return "DW_AT_BORLAND_property_default";
185*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_unit: return "DW_AT_BORLAND_Delphi_unit";
186*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_class: return "DW_AT_BORLAND_Delphi_class";
187*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_record: return "DW_AT_BORLAND_Delphi_record";
188*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_metaclass: return "DW_AT_BORLAND_Delphi_metaclass";
189*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_constructor: return "DW_AT_BORLAND_Delphi_constructor";
190*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_destructor: return "DW_AT_BORLAND_Delphi_destructor";
191*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_anonymous_method: return "DW_AT_BORLAND_Delphi_anonymous_method";
192*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_interface: return "DW_AT_BORLAND_Delphi_interface";
193*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_ABI: return "DW_AT_BORLAND_Delphi_ABI";
194*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_return: return "DW_AT_BORLAND_Delphi_return";
195*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_Delphi_frameptr: return "DW_AT_BORLAND_Delphi_frameptr";
196*9880d681SAndroid Build Coastguard Worker case DW_AT_BORLAND_closure: return "DW_AT_BORLAND_closure";
197*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_optimized: return "DW_AT_APPLE_optimized";
198*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_flags: return "DW_AT_APPLE_flags";
199*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_isa: return "DW_AT_APPLE_isa";
200*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_block: return "DW_AT_APPLE_block";
201*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_major_runtime_vers: return "DW_AT_APPLE_major_runtime_vers";
202*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_runtime_class: return "DW_AT_APPLE_runtime_class";
203*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_omit_frame_ptr: return "DW_AT_APPLE_omit_frame_ptr";
204*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_property_name: return "DW_AT_APPLE_property_name";
205*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_property_getter: return "DW_AT_APPLE_property_getter";
206*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_property_setter: return "DW_AT_APPLE_property_setter";
207*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_property_attribute: return "DW_AT_APPLE_property_attribute";
208*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_property: return "DW_AT_APPLE_property";
209*9880d681SAndroid Build Coastguard Worker case DW_AT_APPLE_objc_complete_type: return "DW_AT_APPLE_objc_complete_type";
210*9880d681SAndroid Build Coastguard Worker case DW_AT_LLVM_include_path: return "DW_AT_LLVM_include_path";
211*9880d681SAndroid Build Coastguard Worker case DW_AT_LLVM_config_macros: return "DW_AT_LLVM_config_macros";
212*9880d681SAndroid Build Coastguard Worker case DW_AT_LLVM_isysroot: return "DW_AT_LLVM_isysroot";
213*9880d681SAndroid Build Coastguard Worker
214*9880d681SAndroid Build Coastguard Worker // DWARF5 Fission Extension Attribute
215*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_dwo_name: return "DW_AT_GNU_dwo_name";
216*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_dwo_id: return "DW_AT_GNU_dwo_id";
217*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_ranges_base: return "DW_AT_GNU_ranges_base";
218*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_addr_base: return "DW_AT_GNU_addr_base";
219*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_pubnames: return "DW_AT_GNU_pubnames";
220*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_pubtypes: return "DW_AT_GNU_pubtypes";
221*9880d681SAndroid Build Coastguard Worker case DW_AT_GNU_discriminator: return "DW_AT_GNU_discriminator";
222*9880d681SAndroid Build Coastguard Worker }
223*9880d681SAndroid Build Coastguard Worker return nullptr;
224*9880d681SAndroid Build Coastguard Worker }
225*9880d681SAndroid Build Coastguard Worker
FormEncodingString(unsigned Encoding)226*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::FormEncodingString(unsigned Encoding) {
227*9880d681SAndroid Build Coastguard Worker switch (Encoding) {
228*9880d681SAndroid Build Coastguard Worker case DW_FORM_addr: return "DW_FORM_addr";
229*9880d681SAndroid Build Coastguard Worker case DW_FORM_block2: return "DW_FORM_block2";
230*9880d681SAndroid Build Coastguard Worker case DW_FORM_block4: return "DW_FORM_block4";
231*9880d681SAndroid Build Coastguard Worker case DW_FORM_data2: return "DW_FORM_data2";
232*9880d681SAndroid Build Coastguard Worker case DW_FORM_data4: return "DW_FORM_data4";
233*9880d681SAndroid Build Coastguard Worker case DW_FORM_data8: return "DW_FORM_data8";
234*9880d681SAndroid Build Coastguard Worker case DW_FORM_string: return "DW_FORM_string";
235*9880d681SAndroid Build Coastguard Worker case DW_FORM_block: return "DW_FORM_block";
236*9880d681SAndroid Build Coastguard Worker case DW_FORM_block1: return "DW_FORM_block1";
237*9880d681SAndroid Build Coastguard Worker case DW_FORM_data1: return "DW_FORM_data1";
238*9880d681SAndroid Build Coastguard Worker case DW_FORM_flag: return "DW_FORM_flag";
239*9880d681SAndroid Build Coastguard Worker case DW_FORM_sdata: return "DW_FORM_sdata";
240*9880d681SAndroid Build Coastguard Worker case DW_FORM_strp: return "DW_FORM_strp";
241*9880d681SAndroid Build Coastguard Worker case DW_FORM_udata: return "DW_FORM_udata";
242*9880d681SAndroid Build Coastguard Worker case DW_FORM_ref_addr: return "DW_FORM_ref_addr";
243*9880d681SAndroid Build Coastguard Worker case DW_FORM_ref1: return "DW_FORM_ref1";
244*9880d681SAndroid Build Coastguard Worker case DW_FORM_ref2: return "DW_FORM_ref2";
245*9880d681SAndroid Build Coastguard Worker case DW_FORM_ref4: return "DW_FORM_ref4";
246*9880d681SAndroid Build Coastguard Worker case DW_FORM_ref8: return "DW_FORM_ref8";
247*9880d681SAndroid Build Coastguard Worker case DW_FORM_ref_udata: return "DW_FORM_ref_udata";
248*9880d681SAndroid Build Coastguard Worker case DW_FORM_indirect: return "DW_FORM_indirect";
249*9880d681SAndroid Build Coastguard Worker case DW_FORM_sec_offset: return "DW_FORM_sec_offset";
250*9880d681SAndroid Build Coastguard Worker case DW_FORM_exprloc: return "DW_FORM_exprloc";
251*9880d681SAndroid Build Coastguard Worker case DW_FORM_flag_present: return "DW_FORM_flag_present";
252*9880d681SAndroid Build Coastguard Worker case DW_FORM_ref_sig8: return "DW_FORM_ref_sig8";
253*9880d681SAndroid Build Coastguard Worker
254*9880d681SAndroid Build Coastguard Worker // DWARF5 Fission Extension Forms
255*9880d681SAndroid Build Coastguard Worker case DW_FORM_GNU_addr_index: return "DW_FORM_GNU_addr_index";
256*9880d681SAndroid Build Coastguard Worker case DW_FORM_GNU_str_index: return "DW_FORM_GNU_str_index";
257*9880d681SAndroid Build Coastguard Worker
258*9880d681SAndroid Build Coastguard Worker // Alternate debug sections proposal (output of "dwz" tool).
259*9880d681SAndroid Build Coastguard Worker case DW_FORM_GNU_ref_alt: return "DW_FORM_GNU_ref_alt";
260*9880d681SAndroid Build Coastguard Worker case DW_FORM_GNU_strp_alt: return "DW_FORM_GNU_strp_alt";
261*9880d681SAndroid Build Coastguard Worker }
262*9880d681SAndroid Build Coastguard Worker return nullptr;
263*9880d681SAndroid Build Coastguard Worker }
264*9880d681SAndroid Build Coastguard Worker
OperationEncodingString(unsigned Encoding)265*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::OperationEncodingString(unsigned Encoding) {
266*9880d681SAndroid Build Coastguard Worker switch (Encoding) {
267*9880d681SAndroid Build Coastguard Worker default: return nullptr;
268*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_OP(ID, NAME) \
269*9880d681SAndroid Build Coastguard Worker case DW_OP_##NAME: \
270*9880d681SAndroid Build Coastguard Worker return "DW_OP_" #NAME;
271*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
272*9880d681SAndroid Build Coastguard Worker }
273*9880d681SAndroid Build Coastguard Worker }
274*9880d681SAndroid Build Coastguard Worker
getOperationEncoding(StringRef OperationEncodingString)275*9880d681SAndroid Build Coastguard Worker unsigned llvm::dwarf::getOperationEncoding(StringRef OperationEncodingString) {
276*9880d681SAndroid Build Coastguard Worker return StringSwitch<unsigned>(OperationEncodingString)
277*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_OP(ID, NAME) .Case("DW_OP_" #NAME, DW_OP_##NAME)
278*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
279*9880d681SAndroid Build Coastguard Worker .Default(0);
280*9880d681SAndroid Build Coastguard Worker }
281*9880d681SAndroid Build Coastguard Worker
AttributeEncodingString(unsigned Encoding)282*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::AttributeEncodingString(unsigned Encoding) {
283*9880d681SAndroid Build Coastguard Worker switch (Encoding) {
284*9880d681SAndroid Build Coastguard Worker default: return nullptr;
285*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_ATE(ID, NAME) \
286*9880d681SAndroid Build Coastguard Worker case DW_ATE_##NAME: \
287*9880d681SAndroid Build Coastguard Worker return "DW_ATE_" #NAME;
288*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
289*9880d681SAndroid Build Coastguard Worker }
290*9880d681SAndroid Build Coastguard Worker }
291*9880d681SAndroid Build Coastguard Worker
getAttributeEncoding(StringRef EncodingString)292*9880d681SAndroid Build Coastguard Worker unsigned llvm::dwarf::getAttributeEncoding(StringRef EncodingString) {
293*9880d681SAndroid Build Coastguard Worker return StringSwitch<unsigned>(EncodingString)
294*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_ATE(ID, NAME) .Case("DW_ATE_" #NAME, DW_ATE_##NAME)
295*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
296*9880d681SAndroid Build Coastguard Worker .Default(0);
297*9880d681SAndroid Build Coastguard Worker }
298*9880d681SAndroid Build Coastguard Worker
DecimalSignString(unsigned Sign)299*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::DecimalSignString(unsigned Sign) {
300*9880d681SAndroid Build Coastguard Worker switch (Sign) {
301*9880d681SAndroid Build Coastguard Worker case DW_DS_unsigned: return "DW_DS_unsigned";
302*9880d681SAndroid Build Coastguard Worker case DW_DS_leading_overpunch: return "DW_DS_leading_overpunch";
303*9880d681SAndroid Build Coastguard Worker case DW_DS_trailing_overpunch: return "DW_DS_trailing_overpunch";
304*9880d681SAndroid Build Coastguard Worker case DW_DS_leading_separate: return "DW_DS_leading_separate";
305*9880d681SAndroid Build Coastguard Worker case DW_DS_trailing_separate: return "DW_DS_trailing_separate";
306*9880d681SAndroid Build Coastguard Worker }
307*9880d681SAndroid Build Coastguard Worker return nullptr;
308*9880d681SAndroid Build Coastguard Worker }
309*9880d681SAndroid Build Coastguard Worker
EndianityString(unsigned Endian)310*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::EndianityString(unsigned Endian) {
311*9880d681SAndroid Build Coastguard Worker switch (Endian) {
312*9880d681SAndroid Build Coastguard Worker case DW_END_default: return "DW_END_default";
313*9880d681SAndroid Build Coastguard Worker case DW_END_big: return "DW_END_big";
314*9880d681SAndroid Build Coastguard Worker case DW_END_little: return "DW_END_little";
315*9880d681SAndroid Build Coastguard Worker case DW_END_lo_user: return "DW_END_lo_user";
316*9880d681SAndroid Build Coastguard Worker case DW_END_hi_user: return "DW_END_hi_user";
317*9880d681SAndroid Build Coastguard Worker }
318*9880d681SAndroid Build Coastguard Worker return nullptr;
319*9880d681SAndroid Build Coastguard Worker }
320*9880d681SAndroid Build Coastguard Worker
AccessibilityString(unsigned Access)321*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::AccessibilityString(unsigned Access) {
322*9880d681SAndroid Build Coastguard Worker switch (Access) {
323*9880d681SAndroid Build Coastguard Worker // Accessibility codes
324*9880d681SAndroid Build Coastguard Worker case DW_ACCESS_public: return "DW_ACCESS_public";
325*9880d681SAndroid Build Coastguard Worker case DW_ACCESS_protected: return "DW_ACCESS_protected";
326*9880d681SAndroid Build Coastguard Worker case DW_ACCESS_private: return "DW_ACCESS_private";
327*9880d681SAndroid Build Coastguard Worker }
328*9880d681SAndroid Build Coastguard Worker return nullptr;
329*9880d681SAndroid Build Coastguard Worker }
330*9880d681SAndroid Build Coastguard Worker
VisibilityString(unsigned Visibility)331*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::VisibilityString(unsigned Visibility) {
332*9880d681SAndroid Build Coastguard Worker switch (Visibility) {
333*9880d681SAndroid Build Coastguard Worker case DW_VIS_local: return "DW_VIS_local";
334*9880d681SAndroid Build Coastguard Worker case DW_VIS_exported: return "DW_VIS_exported";
335*9880d681SAndroid Build Coastguard Worker case DW_VIS_qualified: return "DW_VIS_qualified";
336*9880d681SAndroid Build Coastguard Worker }
337*9880d681SAndroid Build Coastguard Worker return nullptr;
338*9880d681SAndroid Build Coastguard Worker }
339*9880d681SAndroid Build Coastguard Worker
VirtualityString(unsigned Virtuality)340*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::VirtualityString(unsigned Virtuality) {
341*9880d681SAndroid Build Coastguard Worker switch (Virtuality) {
342*9880d681SAndroid Build Coastguard Worker default:
343*9880d681SAndroid Build Coastguard Worker return nullptr;
344*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_VIRTUALITY(ID, NAME) \
345*9880d681SAndroid Build Coastguard Worker case DW_VIRTUALITY_##NAME: \
346*9880d681SAndroid Build Coastguard Worker return "DW_VIRTUALITY_" #NAME;
347*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
348*9880d681SAndroid Build Coastguard Worker }
349*9880d681SAndroid Build Coastguard Worker }
350*9880d681SAndroid Build Coastguard Worker
getVirtuality(StringRef VirtualityString)351*9880d681SAndroid Build Coastguard Worker unsigned llvm::dwarf::getVirtuality(StringRef VirtualityString) {
352*9880d681SAndroid Build Coastguard Worker return StringSwitch<unsigned>(VirtualityString)
353*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_VIRTUALITY(ID, NAME) \
354*9880d681SAndroid Build Coastguard Worker .Case("DW_VIRTUALITY_" #NAME, DW_VIRTUALITY_##NAME)
355*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
356*9880d681SAndroid Build Coastguard Worker .Default(DW_VIRTUALITY_invalid);
357*9880d681SAndroid Build Coastguard Worker }
358*9880d681SAndroid Build Coastguard Worker
LanguageString(unsigned Language)359*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::LanguageString(unsigned Language) {
360*9880d681SAndroid Build Coastguard Worker switch (Language) {
361*9880d681SAndroid Build Coastguard Worker default:
362*9880d681SAndroid Build Coastguard Worker return nullptr;
363*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_LANG(ID, NAME) \
364*9880d681SAndroid Build Coastguard Worker case DW_LANG_##NAME: \
365*9880d681SAndroid Build Coastguard Worker return "DW_LANG_" #NAME;
366*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
367*9880d681SAndroid Build Coastguard Worker }
368*9880d681SAndroid Build Coastguard Worker }
369*9880d681SAndroid Build Coastguard Worker
getLanguage(StringRef LanguageString)370*9880d681SAndroid Build Coastguard Worker unsigned llvm::dwarf::getLanguage(StringRef LanguageString) {
371*9880d681SAndroid Build Coastguard Worker return StringSwitch<unsigned>(LanguageString)
372*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_LANG(ID, NAME) .Case("DW_LANG_" #NAME, DW_LANG_##NAME)
373*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
374*9880d681SAndroid Build Coastguard Worker .Default(0);
375*9880d681SAndroid Build Coastguard Worker }
376*9880d681SAndroid Build Coastguard Worker
CaseString(unsigned Case)377*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::CaseString(unsigned Case) {
378*9880d681SAndroid Build Coastguard Worker switch (Case) {
379*9880d681SAndroid Build Coastguard Worker case DW_ID_case_sensitive: return "DW_ID_case_sensitive";
380*9880d681SAndroid Build Coastguard Worker case DW_ID_up_case: return "DW_ID_up_case";
381*9880d681SAndroid Build Coastguard Worker case DW_ID_down_case: return "DW_ID_down_case";
382*9880d681SAndroid Build Coastguard Worker case DW_ID_case_insensitive: return "DW_ID_case_insensitive";
383*9880d681SAndroid Build Coastguard Worker }
384*9880d681SAndroid Build Coastguard Worker return nullptr;
385*9880d681SAndroid Build Coastguard Worker }
386*9880d681SAndroid Build Coastguard Worker
ConventionString(unsigned CC)387*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::ConventionString(unsigned CC) {
388*9880d681SAndroid Build Coastguard Worker switch (CC) {
389*9880d681SAndroid Build Coastguard Worker default:
390*9880d681SAndroid Build Coastguard Worker return nullptr;
391*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_CC(ID, NAME) \
392*9880d681SAndroid Build Coastguard Worker case DW_CC_##NAME: \
393*9880d681SAndroid Build Coastguard Worker return "DW_CC_" #NAME;
394*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
395*9880d681SAndroid Build Coastguard Worker }
396*9880d681SAndroid Build Coastguard Worker }
397*9880d681SAndroid Build Coastguard Worker
getCallingConvention(StringRef CCString)398*9880d681SAndroid Build Coastguard Worker unsigned llvm::dwarf::getCallingConvention(StringRef CCString) {
399*9880d681SAndroid Build Coastguard Worker return StringSwitch<unsigned>(CCString)
400*9880d681SAndroid Build Coastguard Worker #define HANDLE_DW_CC(ID, NAME) .Case("DW_CC_" #NAME, DW_CC_##NAME)
401*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/Dwarf.def"
402*9880d681SAndroid Build Coastguard Worker .Default(0);
403*9880d681SAndroid Build Coastguard Worker }
404*9880d681SAndroid Build Coastguard Worker
InlineCodeString(unsigned Code)405*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::InlineCodeString(unsigned Code) {
406*9880d681SAndroid Build Coastguard Worker switch (Code) {
407*9880d681SAndroid Build Coastguard Worker case DW_INL_not_inlined: return "DW_INL_not_inlined";
408*9880d681SAndroid Build Coastguard Worker case DW_INL_inlined: return "DW_INL_inlined";
409*9880d681SAndroid Build Coastguard Worker case DW_INL_declared_not_inlined: return "DW_INL_declared_not_inlined";
410*9880d681SAndroid Build Coastguard Worker case DW_INL_declared_inlined: return "DW_INL_declared_inlined";
411*9880d681SAndroid Build Coastguard Worker }
412*9880d681SAndroid Build Coastguard Worker return nullptr;
413*9880d681SAndroid Build Coastguard Worker }
414*9880d681SAndroid Build Coastguard Worker
ArrayOrderString(unsigned Order)415*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::ArrayOrderString(unsigned Order) {
416*9880d681SAndroid Build Coastguard Worker switch (Order) {
417*9880d681SAndroid Build Coastguard Worker case DW_ORD_row_major: return "DW_ORD_row_major";
418*9880d681SAndroid Build Coastguard Worker case DW_ORD_col_major: return "DW_ORD_col_major";
419*9880d681SAndroid Build Coastguard Worker }
420*9880d681SAndroid Build Coastguard Worker return nullptr;
421*9880d681SAndroid Build Coastguard Worker }
422*9880d681SAndroid Build Coastguard Worker
DiscriminantString(unsigned Discriminant)423*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::DiscriminantString(unsigned Discriminant) {
424*9880d681SAndroid Build Coastguard Worker switch (Discriminant) {
425*9880d681SAndroid Build Coastguard Worker case DW_DSC_label: return "DW_DSC_label";
426*9880d681SAndroid Build Coastguard Worker case DW_DSC_range: return "DW_DSC_range";
427*9880d681SAndroid Build Coastguard Worker }
428*9880d681SAndroid Build Coastguard Worker return nullptr;
429*9880d681SAndroid Build Coastguard Worker }
430*9880d681SAndroid Build Coastguard Worker
LNStandardString(unsigned Standard)431*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::LNStandardString(unsigned Standard) {
432*9880d681SAndroid Build Coastguard Worker switch (Standard) {
433*9880d681SAndroid Build Coastguard Worker case DW_LNS_copy: return "DW_LNS_copy";
434*9880d681SAndroid Build Coastguard Worker case DW_LNS_advance_pc: return "DW_LNS_advance_pc";
435*9880d681SAndroid Build Coastguard Worker case DW_LNS_advance_line: return "DW_LNS_advance_line";
436*9880d681SAndroid Build Coastguard Worker case DW_LNS_set_file: return "DW_LNS_set_file";
437*9880d681SAndroid Build Coastguard Worker case DW_LNS_set_column: return "DW_LNS_set_column";
438*9880d681SAndroid Build Coastguard Worker case DW_LNS_negate_stmt: return "DW_LNS_negate_stmt";
439*9880d681SAndroid Build Coastguard Worker case DW_LNS_set_basic_block: return "DW_LNS_set_basic_block";
440*9880d681SAndroid Build Coastguard Worker case DW_LNS_const_add_pc: return "DW_LNS_const_add_pc";
441*9880d681SAndroid Build Coastguard Worker case DW_LNS_fixed_advance_pc: return "DW_LNS_fixed_advance_pc";
442*9880d681SAndroid Build Coastguard Worker case DW_LNS_set_prologue_end: return "DW_LNS_set_prologue_end";
443*9880d681SAndroid Build Coastguard Worker case DW_LNS_set_epilogue_begin: return "DW_LNS_set_epilogue_begin";
444*9880d681SAndroid Build Coastguard Worker case DW_LNS_set_isa: return "DW_LNS_set_isa";
445*9880d681SAndroid Build Coastguard Worker }
446*9880d681SAndroid Build Coastguard Worker return nullptr;
447*9880d681SAndroid Build Coastguard Worker }
448*9880d681SAndroid Build Coastguard Worker
LNExtendedString(unsigned Encoding)449*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::LNExtendedString(unsigned Encoding) {
450*9880d681SAndroid Build Coastguard Worker switch (Encoding) {
451*9880d681SAndroid Build Coastguard Worker // Line Number Extended Opcode Encodings
452*9880d681SAndroid Build Coastguard Worker case DW_LNE_end_sequence: return "DW_LNE_end_sequence";
453*9880d681SAndroid Build Coastguard Worker case DW_LNE_set_address: return "DW_LNE_set_address";
454*9880d681SAndroid Build Coastguard Worker case DW_LNE_define_file: return "DW_LNE_define_file";
455*9880d681SAndroid Build Coastguard Worker case DW_LNE_set_discriminator: return "DW_LNE_set_discriminator";
456*9880d681SAndroid Build Coastguard Worker case DW_LNE_lo_user: return "DW_LNE_lo_user";
457*9880d681SAndroid Build Coastguard Worker case DW_LNE_hi_user: return "DW_LNE_hi_user";
458*9880d681SAndroid Build Coastguard Worker }
459*9880d681SAndroid Build Coastguard Worker return nullptr;
460*9880d681SAndroid Build Coastguard Worker }
461*9880d681SAndroid Build Coastguard Worker
MacinfoString(unsigned Encoding)462*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::MacinfoString(unsigned Encoding) {
463*9880d681SAndroid Build Coastguard Worker switch (Encoding) {
464*9880d681SAndroid Build Coastguard Worker // Macinfo Type Encodings
465*9880d681SAndroid Build Coastguard Worker case DW_MACINFO_define: return "DW_MACINFO_define";
466*9880d681SAndroid Build Coastguard Worker case DW_MACINFO_undef: return "DW_MACINFO_undef";
467*9880d681SAndroid Build Coastguard Worker case DW_MACINFO_start_file: return "DW_MACINFO_start_file";
468*9880d681SAndroid Build Coastguard Worker case DW_MACINFO_end_file: return "DW_MACINFO_end_file";
469*9880d681SAndroid Build Coastguard Worker case DW_MACINFO_vendor_ext: return "DW_MACINFO_vendor_ext";
470*9880d681SAndroid Build Coastguard Worker case DW_MACINFO_invalid: return "DW_MACINFO_invalid";
471*9880d681SAndroid Build Coastguard Worker }
472*9880d681SAndroid Build Coastguard Worker return nullptr;
473*9880d681SAndroid Build Coastguard Worker }
474*9880d681SAndroid Build Coastguard Worker
getMacinfo(StringRef MacinfoString)475*9880d681SAndroid Build Coastguard Worker unsigned llvm::dwarf::getMacinfo(StringRef MacinfoString) {
476*9880d681SAndroid Build Coastguard Worker return StringSwitch<unsigned>(MacinfoString)
477*9880d681SAndroid Build Coastguard Worker .Case("DW_MACINFO_define", DW_MACINFO_define)
478*9880d681SAndroid Build Coastguard Worker .Case("DW_MACINFO_undef", DW_MACINFO_undef)
479*9880d681SAndroid Build Coastguard Worker .Case("DW_MACINFO_start_file", DW_MACINFO_start_file)
480*9880d681SAndroid Build Coastguard Worker .Case("DW_MACINFO_end_file", DW_MACINFO_end_file)
481*9880d681SAndroid Build Coastguard Worker .Case("DW_MACINFO_vendor_ext", DW_MACINFO_vendor_ext)
482*9880d681SAndroid Build Coastguard Worker .Default(DW_MACINFO_invalid);
483*9880d681SAndroid Build Coastguard Worker }
484*9880d681SAndroid Build Coastguard Worker
CallFrameString(unsigned Encoding)485*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::CallFrameString(unsigned Encoding) {
486*9880d681SAndroid Build Coastguard Worker switch (Encoding) {
487*9880d681SAndroid Build Coastguard Worker case DW_CFA_nop: return "DW_CFA_nop";
488*9880d681SAndroid Build Coastguard Worker case DW_CFA_advance_loc: return "DW_CFA_advance_loc";
489*9880d681SAndroid Build Coastguard Worker case DW_CFA_offset: return "DW_CFA_offset";
490*9880d681SAndroid Build Coastguard Worker case DW_CFA_restore: return "DW_CFA_restore";
491*9880d681SAndroid Build Coastguard Worker case DW_CFA_set_loc: return "DW_CFA_set_loc";
492*9880d681SAndroid Build Coastguard Worker case DW_CFA_advance_loc1: return "DW_CFA_advance_loc1";
493*9880d681SAndroid Build Coastguard Worker case DW_CFA_advance_loc2: return "DW_CFA_advance_loc2";
494*9880d681SAndroid Build Coastguard Worker case DW_CFA_advance_loc4: return "DW_CFA_advance_loc4";
495*9880d681SAndroid Build Coastguard Worker case DW_CFA_offset_extended: return "DW_CFA_offset_extended";
496*9880d681SAndroid Build Coastguard Worker case DW_CFA_restore_extended: return "DW_CFA_restore_extended";
497*9880d681SAndroid Build Coastguard Worker case DW_CFA_undefined: return "DW_CFA_undefined";
498*9880d681SAndroid Build Coastguard Worker case DW_CFA_same_value: return "DW_CFA_same_value";
499*9880d681SAndroid Build Coastguard Worker case DW_CFA_register: return "DW_CFA_register";
500*9880d681SAndroid Build Coastguard Worker case DW_CFA_remember_state: return "DW_CFA_remember_state";
501*9880d681SAndroid Build Coastguard Worker case DW_CFA_restore_state: return "DW_CFA_restore_state";
502*9880d681SAndroid Build Coastguard Worker case DW_CFA_def_cfa: return "DW_CFA_def_cfa";
503*9880d681SAndroid Build Coastguard Worker case DW_CFA_def_cfa_register: return "DW_CFA_def_cfa_register";
504*9880d681SAndroid Build Coastguard Worker case DW_CFA_def_cfa_offset: return "DW_CFA_def_cfa_offset";
505*9880d681SAndroid Build Coastguard Worker case DW_CFA_def_cfa_expression: return "DW_CFA_def_cfa_expression";
506*9880d681SAndroid Build Coastguard Worker case DW_CFA_expression: return "DW_CFA_expression";
507*9880d681SAndroid Build Coastguard Worker case DW_CFA_offset_extended_sf: return "DW_CFA_offset_extended_sf";
508*9880d681SAndroid Build Coastguard Worker case DW_CFA_def_cfa_sf: return "DW_CFA_def_cfa_sf";
509*9880d681SAndroid Build Coastguard Worker case DW_CFA_def_cfa_offset_sf: return "DW_CFA_def_cfa_offset_sf";
510*9880d681SAndroid Build Coastguard Worker case DW_CFA_val_offset: return "DW_CFA_val_offset";
511*9880d681SAndroid Build Coastguard Worker case DW_CFA_val_offset_sf: return "DW_CFA_val_offset_sf";
512*9880d681SAndroid Build Coastguard Worker case DW_CFA_val_expression: return "DW_CFA_val_expression";
513*9880d681SAndroid Build Coastguard Worker case DW_CFA_MIPS_advance_loc8: return "DW_CFA_MIPS_advance_loc8";
514*9880d681SAndroid Build Coastguard Worker case DW_CFA_GNU_window_save: return "DW_CFA_GNU_window_save";
515*9880d681SAndroid Build Coastguard Worker case DW_CFA_GNU_args_size: return "DW_CFA_GNU_args_size";
516*9880d681SAndroid Build Coastguard Worker case DW_CFA_lo_user: return "DW_CFA_lo_user";
517*9880d681SAndroid Build Coastguard Worker case DW_CFA_hi_user: return "DW_CFA_hi_user";
518*9880d681SAndroid Build Coastguard Worker }
519*9880d681SAndroid Build Coastguard Worker return nullptr;
520*9880d681SAndroid Build Coastguard Worker }
521*9880d681SAndroid Build Coastguard Worker
ApplePropertyString(unsigned Prop)522*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::ApplePropertyString(unsigned Prop) {
523*9880d681SAndroid Build Coastguard Worker switch (Prop) {
524*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_readonly:
525*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_readonly";
526*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_getter:
527*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_getter";
528*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_assign:
529*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_assign";
530*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_readwrite:
531*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_readwrite";
532*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_retain:
533*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_retain";
534*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_copy:
535*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_copy";
536*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_nonatomic:
537*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_nonatomic";
538*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_setter:
539*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_setter";
540*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_atomic:
541*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_atomic";
542*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_weak:
543*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_weak";
544*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_strong:
545*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_strong";
546*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_unsafe_unretained:
547*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_unsafe_unretained";
548*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_nullability:
549*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_nullability";
550*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_null_resettable:
551*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_null_resettable";
552*9880d681SAndroid Build Coastguard Worker case DW_APPLE_PROPERTY_class:
553*9880d681SAndroid Build Coastguard Worker return "DW_APPLE_PROPERTY_class";
554*9880d681SAndroid Build Coastguard Worker }
555*9880d681SAndroid Build Coastguard Worker return nullptr;
556*9880d681SAndroid Build Coastguard Worker }
557*9880d681SAndroid Build Coastguard Worker
AtomTypeString(unsigned AT)558*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::AtomTypeString(unsigned AT) {
559*9880d681SAndroid Build Coastguard Worker switch (AT) {
560*9880d681SAndroid Build Coastguard Worker case dwarf::DW_ATOM_null:
561*9880d681SAndroid Build Coastguard Worker return "DW_ATOM_null";
562*9880d681SAndroid Build Coastguard Worker case dwarf::DW_ATOM_die_offset:
563*9880d681SAndroid Build Coastguard Worker return "DW_ATOM_die_offset";
564*9880d681SAndroid Build Coastguard Worker case DW_ATOM_cu_offset:
565*9880d681SAndroid Build Coastguard Worker return "DW_ATOM_cu_offset";
566*9880d681SAndroid Build Coastguard Worker case DW_ATOM_die_tag:
567*9880d681SAndroid Build Coastguard Worker return "DW_ATOM_die_tag";
568*9880d681SAndroid Build Coastguard Worker case DW_ATOM_type_flags:
569*9880d681SAndroid Build Coastguard Worker return "DW_ATOM_type_flags";
570*9880d681SAndroid Build Coastguard Worker }
571*9880d681SAndroid Build Coastguard Worker return nullptr;
572*9880d681SAndroid Build Coastguard Worker }
573*9880d681SAndroid Build Coastguard Worker
GDBIndexEntryKindString(GDBIndexEntryKind Kind)574*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::GDBIndexEntryKindString(GDBIndexEntryKind Kind) {
575*9880d681SAndroid Build Coastguard Worker switch (Kind) {
576*9880d681SAndroid Build Coastguard Worker case GIEK_NONE:
577*9880d681SAndroid Build Coastguard Worker return "NONE";
578*9880d681SAndroid Build Coastguard Worker case GIEK_TYPE:
579*9880d681SAndroid Build Coastguard Worker return "TYPE";
580*9880d681SAndroid Build Coastguard Worker case GIEK_VARIABLE:
581*9880d681SAndroid Build Coastguard Worker return "VARIABLE";
582*9880d681SAndroid Build Coastguard Worker case GIEK_FUNCTION:
583*9880d681SAndroid Build Coastguard Worker return "FUNCTION";
584*9880d681SAndroid Build Coastguard Worker case GIEK_OTHER:
585*9880d681SAndroid Build Coastguard Worker return "OTHER";
586*9880d681SAndroid Build Coastguard Worker case GIEK_UNUSED5:
587*9880d681SAndroid Build Coastguard Worker return "UNUSED5";
588*9880d681SAndroid Build Coastguard Worker case GIEK_UNUSED6:
589*9880d681SAndroid Build Coastguard Worker return "UNUSED6";
590*9880d681SAndroid Build Coastguard Worker case GIEK_UNUSED7:
591*9880d681SAndroid Build Coastguard Worker return "UNUSED7";
592*9880d681SAndroid Build Coastguard Worker }
593*9880d681SAndroid Build Coastguard Worker llvm_unreachable("Unknown GDBIndexEntryKind value");
594*9880d681SAndroid Build Coastguard Worker }
595*9880d681SAndroid Build Coastguard Worker
GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)596*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage) {
597*9880d681SAndroid Build Coastguard Worker switch (Linkage) {
598*9880d681SAndroid Build Coastguard Worker case GIEL_EXTERNAL:
599*9880d681SAndroid Build Coastguard Worker return "EXTERNAL";
600*9880d681SAndroid Build Coastguard Worker case GIEL_STATIC:
601*9880d681SAndroid Build Coastguard Worker return "STATIC";
602*9880d681SAndroid Build Coastguard Worker }
603*9880d681SAndroid Build Coastguard Worker llvm_unreachable("Unknown GDBIndexEntryLinkage value");
604*9880d681SAndroid Build Coastguard Worker }
605*9880d681SAndroid Build Coastguard Worker
AttributeValueString(uint16_t Attr,unsigned Val)606*9880d681SAndroid Build Coastguard Worker const char *llvm::dwarf::AttributeValueString(uint16_t Attr, unsigned Val) {
607*9880d681SAndroid Build Coastguard Worker switch (Attr) {
608*9880d681SAndroid Build Coastguard Worker case DW_AT_accessibility:
609*9880d681SAndroid Build Coastguard Worker return AccessibilityString(Val);
610*9880d681SAndroid Build Coastguard Worker case DW_AT_virtuality:
611*9880d681SAndroid Build Coastguard Worker return VirtualityString(Val);
612*9880d681SAndroid Build Coastguard Worker case DW_AT_language:
613*9880d681SAndroid Build Coastguard Worker return LanguageString(Val);
614*9880d681SAndroid Build Coastguard Worker case DW_AT_encoding:
615*9880d681SAndroid Build Coastguard Worker return AttributeEncodingString(Val);
616*9880d681SAndroid Build Coastguard Worker case DW_AT_decimal_sign:
617*9880d681SAndroid Build Coastguard Worker return DecimalSignString(Val);
618*9880d681SAndroid Build Coastguard Worker case DW_AT_endianity:
619*9880d681SAndroid Build Coastguard Worker return EndianityString(Val);
620*9880d681SAndroid Build Coastguard Worker case DW_AT_visibility:
621*9880d681SAndroid Build Coastguard Worker return VisibilityString(Val);
622*9880d681SAndroid Build Coastguard Worker case DW_AT_identifier_case:
623*9880d681SAndroid Build Coastguard Worker return CaseString(Val);
624*9880d681SAndroid Build Coastguard Worker case DW_AT_calling_convention:
625*9880d681SAndroid Build Coastguard Worker return ConventionString(Val);
626*9880d681SAndroid Build Coastguard Worker case DW_AT_inline:
627*9880d681SAndroid Build Coastguard Worker return InlineCodeString(Val);
628*9880d681SAndroid Build Coastguard Worker case DW_AT_ordering:
629*9880d681SAndroid Build Coastguard Worker return ArrayOrderString(Val);
630*9880d681SAndroid Build Coastguard Worker case DW_AT_discr_value:
631*9880d681SAndroid Build Coastguard Worker return DiscriminantString(Val);
632*9880d681SAndroid Build Coastguard Worker }
633*9880d681SAndroid Build Coastguard Worker
634*9880d681SAndroid Build Coastguard Worker return nullptr;
635*9880d681SAndroid Build Coastguard Worker }
636