LLVM  14.0.0git
Dwarf.cpp
Go to the documentation of this file.
1 //===-- llvm/BinaryFormat/Dwarf.cpp - Dwarf Framework ------------*- C++-*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains support for generic dwarf information.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 #include "llvm/ADT/StringSwitch.h"
15 #include "llvm/ADT/Triple.h"
17 
18 using namespace llvm;
19 using namespace dwarf;
20 
22  switch (Tag) {
23  default:
24  return StringRef();
25 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
26  case DW_TAG_##NAME: \
27  return "DW_TAG_" #NAME;
28 #include "llvm/BinaryFormat/Dwarf.def"
29  }
30 }
31 
34 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
35  .Case("DW_TAG_" #NAME, DW_TAG_##NAME)
36 #include "llvm/BinaryFormat/Dwarf.def"
38 }
39 
41  switch (Tag) {
42  default:
43  return 0;
44 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
45  case DW_TAG_##NAME: \
46  return VERSION;
47 #include "llvm/BinaryFormat/Dwarf.def"
48  }
49 }
50 
52  switch (Tag) {
53  default:
54  return 0;
55 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
56  case DW_TAG_##NAME: \
57  return DWARF_VENDOR_##VENDOR;
58 #include "llvm/BinaryFormat/Dwarf.def"
59  }
60 }
61 
63  switch (Children) {
64  case DW_CHILDREN_no:
65  return "DW_CHILDREN_no";
66  case DW_CHILDREN_yes:
67  return "DW_CHILDREN_yes";
68  }
69  return StringRef();
70 }
71 
73  switch (Attribute) {
74  default:
75  return StringRef();
76 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
77  case DW_AT_##NAME: \
78  return "DW_AT_" #NAME;
79 #include "llvm/BinaryFormat/Dwarf.def"
80  }
81 }
82 
84  switch (Attribute) {
85  default:
86  return 0;
87 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
88  case DW_AT_##NAME: \
89  return VERSION;
90 #include "llvm/BinaryFormat/Dwarf.def"
91  }
92 }
93 
95  switch (Attribute) {
96  default:
97  return 0;
98 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
99  case DW_AT_##NAME: \
100  return DWARF_VENDOR_##VENDOR;
101 #include "llvm/BinaryFormat/Dwarf.def"
102  }
103 }
104 
106  switch (Encoding) {
107  default:
108  return StringRef();
109 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) \
110  case DW_FORM_##NAME: \
111  return "DW_FORM_" #NAME;
112 #include "llvm/BinaryFormat/Dwarf.def"
113  }
114 }
115 
117  switch (Form) {
118  default:
119  return 0;
120 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) \
121  case DW_FORM_##NAME: \
122  return VERSION;
123 #include "llvm/BinaryFormat/Dwarf.def"
124  }
125 }
126 
128  switch (Form) {
129  default:
130  return 0;
131 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) \
132  case DW_FORM_##NAME: \
133  return DWARF_VENDOR_##VENDOR;
134 #include "llvm/BinaryFormat/Dwarf.def"
135  }
136 }
137 
139  switch (Encoding) {
140  default:
141  return StringRef();
142 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
143  case DW_OP_##NAME: \
144  return "DW_OP_" #NAME;
145 #include "llvm/BinaryFormat/Dwarf.def"
146  case DW_OP_LLVM_convert:
147  return "DW_OP_LLVM_convert";
148  case DW_OP_LLVM_fragment:
149  return "DW_OP_LLVM_fragment";
151  return "DW_OP_LLVM_tag_offset";
153  return "DW_OP_LLVM_entry_value";
155  return "DW_OP_LLVM_implicit_pointer";
156  case DW_OP_LLVM_arg:
157  return "DW_OP_LLVM_arg";
158  }
159 }
160 
163 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
164  .Case("DW_OP_" #NAME, DW_OP_##NAME)
165 #include "llvm/BinaryFormat/Dwarf.def"
166  .Case("DW_OP_LLVM_convert", DW_OP_LLVM_convert)
167  .Case("DW_OP_LLVM_fragment", DW_OP_LLVM_fragment)
168  .Case("DW_OP_LLVM_tag_offset", DW_OP_LLVM_tag_offset)
169  .Case("DW_OP_LLVM_entry_value", DW_OP_LLVM_entry_value)
170  .Case("DW_OP_LLVM_implicit_pointer", DW_OP_LLVM_implicit_pointer)
171  .Case("DW_OP_LLVM_arg", DW_OP_LLVM_arg)
172  .Default(0);
173 }
174 
176  switch (Op) {
177  default:
178  return 0;
179 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
180  case DW_OP_##NAME: \
181  return VERSION;
182 #include "llvm/BinaryFormat/Dwarf.def"
183  }
184 }
185 
187  switch (Op) {
188  default:
189  return 0;
190 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
191  case DW_OP_##NAME: \
192  return DWARF_VENDOR_##VENDOR;
193 #include "llvm/BinaryFormat/Dwarf.def"
194  }
195 }
196 
198  switch (Encoding) {
199  default:
200  return StringRef();
201 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
202  case DW_ATE_##NAME: \
203  return "DW_ATE_" #NAME;
204 #include "llvm/BinaryFormat/Dwarf.def"
205  }
206 }
207 
209  return StringSwitch<unsigned>(EncodingString)
210 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
211  .Case("DW_ATE_" #NAME, DW_ATE_##NAME)
212 #include "llvm/BinaryFormat/Dwarf.def"
213  .Default(0);
214 }
215 
217  switch (ATE) {
218  default:
219  return 0;
220 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
221  case DW_ATE_##NAME: \
222  return VERSION;
223 #include "llvm/BinaryFormat/Dwarf.def"
224  }
225 }
226 
228  switch (ATE) {
229  default:
230  return 0;
231 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
232  case DW_ATE_##NAME: \
233  return DWARF_VENDOR_##VENDOR;
234 #include "llvm/BinaryFormat/Dwarf.def"
235  }
236 }
237 
239  switch (Sign) {
240  case DW_DS_unsigned:
241  return "DW_DS_unsigned";
243  return "DW_DS_leading_overpunch";
245  return "DW_DS_trailing_overpunch";
247  return "DW_DS_leading_separate";
249  return "DW_DS_trailing_separate";
250  }
251  return StringRef();
252 }
253 
255  switch (Endian) {
256  case DW_END_default:
257  return "DW_END_default";
258  case DW_END_big:
259  return "DW_END_big";
260  case DW_END_little:
261  return "DW_END_little";
262  case DW_END_lo_user:
263  return "DW_END_lo_user";
264  case DW_END_hi_user:
265  return "DW_END_hi_user";
266  }
267  return StringRef();
268 }
269 
271  switch (Access) {
272  // Accessibility codes
273  case DW_ACCESS_public:
274  return "DW_ACCESS_public";
275  case DW_ACCESS_protected:
276  return "DW_ACCESS_protected";
277  case DW_ACCESS_private:
278  return "DW_ACCESS_private";
279  }
280  return StringRef();
281 }
282 
283 StringRef llvm::dwarf::DefaultedMemberString(unsigned DefaultedEncodings) {
284  switch (DefaultedEncodings) {
285  // Defaulted Member Encodings codes
286  case DW_DEFAULTED_no:
287  return "DW_DEFAULTED_no";
288  case DW_DEFAULTED_in_class:
289  return "DW_DEFAULTED_in_class";
290  case DW_DEFAULTED_out_of_class:
291  return "DW_DEFAULTED_out_of_class";
292  }
293  return StringRef();
294 }
295 
297  switch (Visibility) {
298  case DW_VIS_local:
299  return "DW_VIS_local";
300  case DW_VIS_exported:
301  return "DW_VIS_exported";
302  case DW_VIS_qualified:
303  return "DW_VIS_qualified";
304  }
305  return StringRef();
306 }
307 
309  switch (Virtuality) {
310  default:
311  return StringRef();
312 #define HANDLE_DW_VIRTUALITY(ID, NAME) \
313  case DW_VIRTUALITY_##NAME: \
314  return "DW_VIRTUALITY_" #NAME;
315 #include "llvm/BinaryFormat/Dwarf.def"
316  }
317 }
318 
321 #define HANDLE_DW_VIRTUALITY(ID, NAME) \
322  .Case("DW_VIRTUALITY_" #NAME, DW_VIRTUALITY_##NAME)
323 #include "llvm/BinaryFormat/Dwarf.def"
325 }
326 
328  switch (Language) {
329  default:
330  return StringRef();
331 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
332  case DW_LANG_##NAME: \
333  return "DW_LANG_" #NAME;
334 #include "llvm/BinaryFormat/Dwarf.def"
335  }
336 }
337 
340 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
341  .Case("DW_LANG_" #NAME, DW_LANG_##NAME)
342 #include "llvm/BinaryFormat/Dwarf.def"
343  .Default(0);
344 }
345 
347  switch (Lang) {
348  default:
349  return 0;
350 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
351  case DW_LANG_##NAME: \
352  return VERSION;
353 #include "llvm/BinaryFormat/Dwarf.def"
354  }
355 }
356 
358  switch (Lang) {
359  default:
360  return 0;
361 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
362  case DW_LANG_##NAME: \
363  return DWARF_VENDOR_##VENDOR;
364 #include "llvm/BinaryFormat/Dwarf.def"
365  }
366 }
367 
369  switch (Lang) {
370  default:
371  return None;
372 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
373  case DW_LANG_##NAME: \
374  return LOWER_BOUND;
375 #include "llvm/BinaryFormat/Dwarf.def"
376  }
377 }
378 
380  switch (Case) {
382  return "DW_ID_case_sensitive";
383  case DW_ID_up_case:
384  return "DW_ID_up_case";
385  case DW_ID_down_case:
386  return "DW_ID_down_case";
388  return "DW_ID_case_insensitive";
389  }
390  return StringRef();
391 }
392 
394  switch (CC) {
395  default:
396  return StringRef();
397 #define HANDLE_DW_CC(ID, NAME) \
398  case DW_CC_##NAME: \
399  return "DW_CC_" #NAME;
400 #include "llvm/BinaryFormat/Dwarf.def"
401  }
402 }
403 
405  return StringSwitch<unsigned>(CCString)
406 #define HANDLE_DW_CC(ID, NAME) .Case("DW_CC_" #NAME, DW_CC_##NAME)
407 #include "llvm/BinaryFormat/Dwarf.def"
408  .Default(0);
409 }
410 
412  switch (Code) {
413  case DW_INL_not_inlined:
414  return "DW_INL_not_inlined";
415  case DW_INL_inlined:
416  return "DW_INL_inlined";
418  return "DW_INL_declared_not_inlined";
420  return "DW_INL_declared_inlined";
421  }
422  return StringRef();
423 }
424 
426  switch (Order) {
427  case DW_ORD_row_major:
428  return "DW_ORD_row_major";
429  case DW_ORD_col_major:
430  return "DW_ORD_col_major";
431  }
432  return StringRef();
433 }
434 
436  switch (Standard) {
437  default:
438  return StringRef();
439 #define HANDLE_DW_LNS(ID, NAME) \
440  case DW_LNS_##NAME: \
441  return "DW_LNS_" #NAME;
442 #include "llvm/BinaryFormat/Dwarf.def"
443  }
444 }
445 
447  switch (Encoding) {
448  default:
449  return StringRef();
450 #define HANDLE_DW_LNE(ID, NAME) \
451  case DW_LNE_##NAME: \
452  return "DW_LNE_" #NAME;
453 #include "llvm/BinaryFormat/Dwarf.def"
454  }
455 }
456 
458  switch (Encoding) {
459  // Macinfo Type Encodings
460  case DW_MACINFO_define:
461  return "DW_MACINFO_define";
462  case DW_MACINFO_undef:
463  return "DW_MACINFO_undef";
465  return "DW_MACINFO_start_file";
466  case DW_MACINFO_end_file:
467  return "DW_MACINFO_end_file";
469  return "DW_MACINFO_vendor_ext";
470  case DW_MACINFO_invalid:
471  return "DW_MACINFO_invalid";
472  }
473  return StringRef();
474 }
475 
478  .Case("DW_MACINFO_define", DW_MACINFO_define)
479  .Case("DW_MACINFO_undef", DW_MACINFO_undef)
480  .Case("DW_MACINFO_start_file", DW_MACINFO_start_file)
481  .Case("DW_MACINFO_end_file", DW_MACINFO_end_file)
482  .Case("DW_MACINFO_vendor_ext", DW_MACINFO_vendor_ext)
484 }
485 
487  switch (Encoding) {
488  default:
489  return StringRef();
490 #define HANDLE_DW_MACRO(ID, NAME) \
491  case DW_MACRO_##NAME: \
492  return "DW_MACRO_" #NAME;
493 #include "llvm/BinaryFormat/Dwarf.def"
494  }
495 }
496 
498  switch (Encoding) {
499  default:
500  return StringRef();
501 #define HANDLE_DW_MACRO_GNU(ID, NAME) \
502  case DW_MACRO_GNU_##NAME: \
503  return "DW_MACRO_GNU_" #NAME;
504 #include "llvm/BinaryFormat/Dwarf.def"
505  }
506 }
507 
510 #define HANDLE_DW_MACRO(ID, NAME) .Case("DW_MACRO_" #NAME, ID)
511 #include "llvm/BinaryFormat/Dwarf.def"
513 }
515  switch (Encoding) {
516  default:
517  return StringRef();
518 #define HANDLE_DW_RLE(ID, NAME) \
519  case DW_RLE_##NAME: \
520  return "DW_RLE_" #NAME;
521 #include "llvm/BinaryFormat/Dwarf.def"
522  }
523 }
524 
526  switch (Encoding) {
527  default:
528  return StringRef();
529 #define HANDLE_DW_LLE(ID, NAME) \
530  case DW_LLE_##NAME: \
531  return "DW_LLE_" #NAME;
532 #include "llvm/BinaryFormat/Dwarf.def"
533  }
534 }
535 
537  Triple::ArchType Arch) {
538  assert(Arch != llvm::Triple::ArchType::UnknownArch);
539 #define SELECT_AARCH64 (Arch == llvm::Triple::aarch64_be || Arch == llvm::Triple::aarch64)
540 #define SELECT_MIPS64 Arch == llvm::Triple::mips64
541 #define SELECT_SPARC (Arch == llvm::Triple::sparc || Arch == llvm::Triple::sparcv9)
542 #define SELECT_X86 (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
543 #define HANDLE_DW_CFA(ID, NAME)
544 #define HANDLE_DW_CFA_PRED(ID, NAME, PRED) \
545  if (ID == Encoding && PRED) \
546  return "DW_CFA_" #NAME;
547 #include "llvm/BinaryFormat/Dwarf.def"
548 
549  switch (Encoding) {
550  default:
551  return StringRef();
552 #define HANDLE_DW_CFA_PRED(ID, NAME, PRED)
553 #define HANDLE_DW_CFA(ID, NAME) \
554  case DW_CFA_##NAME: \
555  return "DW_CFA_" #NAME;
556 #include "llvm/BinaryFormat/Dwarf.def"
557 
558 #undef SELECT_X86
559 #undef SELECT_SPARC
560 #undef SELECT_MIPS64
561 #undef SELECT_AARCH64
562  }
563 }
564 
566  switch (Prop) {
567  default:
568  return StringRef();
569 #define HANDLE_DW_APPLE_PROPERTY(ID, NAME) \
570  case DW_APPLE_PROPERTY_##NAME: \
571  return "DW_APPLE_PROPERTY_" #NAME;
572 #include "llvm/BinaryFormat/Dwarf.def"
573  }
574 }
575 
577  switch (UT) {
578  default:
579  return StringRef();
580 #define HANDLE_DW_UT(ID, NAME) \
581  case DW_UT_##NAME: \
582  return "DW_UT_" #NAME;
583 #include "llvm/BinaryFormat/Dwarf.def"
584  }
585 }
586 
588  switch (AT) {
589  case dwarf::DW_ATOM_null:
590  return "DW_ATOM_null";
592  return "DW_ATOM_die_offset";
593  case DW_ATOM_cu_offset:
594  return "DW_ATOM_cu_offset";
595  case DW_ATOM_die_tag:
596  return "DW_ATOM_die_tag";
597  case DW_ATOM_type_flags:
599  return "DW_ATOM_type_flags";
601  return "DW_ATOM_qual_name_hash";
602  }
603  return StringRef();
604 }
605 
607  switch (Kind) {
608  case GIEK_NONE:
609  return "NONE";
610  case GIEK_TYPE:
611  return "TYPE";
612  case GIEK_VARIABLE:
613  return "VARIABLE";
614  case GIEK_FUNCTION:
615  return "FUNCTION";
616  case GIEK_OTHER:
617  return "OTHER";
618  case GIEK_UNUSED5:
619  return "UNUSED5";
620  case GIEK_UNUSED6:
621  return "UNUSED6";
622  case GIEK_UNUSED7:
623  return "UNUSED7";
624  }
625  llvm_unreachable("Unknown GDBIndexEntryKind value");
626 }
627 
628 StringRef
630  switch (Linkage) {
631  case GIEL_EXTERNAL:
632  return "EXTERNAL";
633  case GIEL_STATIC:
634  return "STATIC";
635  }
636  llvm_unreachable("Unknown GDBIndexEntryLinkage value");
637 }
638 
640  switch (Attr) {
641  case DW_AT_accessibility:
642  return AccessibilityString(Val);
643  case DW_AT_virtuality:
644  return VirtualityString(Val);
645  case DW_AT_language:
646  return LanguageString(Val);
647  case DW_AT_encoding:
648  return AttributeEncodingString(Val);
649  case DW_AT_decimal_sign:
650  return DecimalSignString(Val);
651  case DW_AT_endianity:
652  return EndianityString(Val);
653  case DW_AT_visibility:
654  return VisibilityString(Val);
655  case DW_AT_identifier_case:
656  return CaseString(Val);
657  case DW_AT_calling_convention:
658  return ConventionString(Val);
659  case DW_AT_inline:
660  return InlineCodeString(Val);
661  case DW_AT_ordering:
662  return ArrayOrderString(Val);
663  case DW_AT_APPLE_runtime_class:
664  return LanguageString(Val);
665  case DW_AT_defaulted:
666  return DefaultedMemberString(Val);
667  }
668 
669  return StringRef();
670 }
671 
673  switch (Atom) {
674  case DW_ATOM_null:
675  return "NULL";
676  case DW_ATOM_die_tag:
677  return TagString(Val);
678  }
679 
680  return StringRef();
681 }
682 
684  switch (Idx) {
685  default:
686  return StringRef();
687 #define HANDLE_DW_IDX(ID, NAME) \
688  case DW_IDX_##NAME: \
689  return "DW_IDX_" #NAME;
690 #include "llvm/BinaryFormat/Dwarf.def"
691  }
692 }
693 
695  FormParams Params) {
696  switch (Form) {
697  case DW_FORM_addr:
698  if (Params)
699  return Params.AddrSize;
700  return None;
701 
702  case DW_FORM_block: // ULEB128 length L followed by L bytes.
703  case DW_FORM_block1: // 1 byte length L followed by L bytes.
704  case DW_FORM_block2: // 2 byte length L followed by L bytes.
705  case DW_FORM_block4: // 4 byte length L followed by L bytes.
706  case DW_FORM_string: // C-string with null terminator.
707  case DW_FORM_sdata: // SLEB128.
708  case DW_FORM_udata: // ULEB128.
709  case DW_FORM_ref_udata: // ULEB128.
710  case DW_FORM_indirect: // ULEB128.
711  case DW_FORM_exprloc: // ULEB128 length L followed by L bytes.
712  case DW_FORM_strx: // ULEB128.
713  case DW_FORM_addrx: // ULEB128.
714  case DW_FORM_loclistx: // ULEB128.
715  case DW_FORM_rnglistx: // ULEB128.
716  case DW_FORM_GNU_addr_index: // ULEB128.
717  case DW_FORM_GNU_str_index: // ULEB128.
718  return None;
719 
720  case DW_FORM_ref_addr:
721  if (Params)
722  return Params.getRefAddrByteSize();
723  return None;
724 
725  case DW_FORM_flag:
726  case DW_FORM_data1:
727  case DW_FORM_ref1:
728  case DW_FORM_strx1:
729  case DW_FORM_addrx1:
730  return 1;
731 
732  case DW_FORM_data2:
733  case DW_FORM_ref2:
734  case DW_FORM_strx2:
735  case DW_FORM_addrx2:
736  return 2;
737 
738  case DW_FORM_strx3:
739  return 3;
740 
741  case DW_FORM_data4:
742  case DW_FORM_ref4:
743  case DW_FORM_ref_sup4:
744  case DW_FORM_strx4:
745  case DW_FORM_addrx4:
746  return 4;
747 
748  case DW_FORM_strp:
749  case DW_FORM_GNU_ref_alt:
750  case DW_FORM_GNU_strp_alt:
751  case DW_FORM_line_strp:
752  case DW_FORM_sec_offset:
753  case DW_FORM_strp_sup:
754  if (Params)
755  return Params.getDwarfOffsetByteSize();
756  return None;
757 
758  case DW_FORM_data8:
759  case DW_FORM_ref8:
760  case DW_FORM_ref_sig8:
761  case DW_FORM_ref_sup8:
762  return 8;
763 
764  case DW_FORM_flag_present:
765  return 0;
766 
767  case DW_FORM_data16:
768  return 16;
769 
770  case DW_FORM_implicit_const:
771  // The implicit value is stored in the abbreviation as a SLEB128, and
772  // there no data in debug info.
773  return 0;
774 
775  default:
776  break;
777  }
778  return None;
779 }
780 
782  bool ExtensionsOk) {
783  if (FormVendor(F) == DWARF_VENDOR_DWARF) {
784  unsigned FV = FormVersion(F);
785  return FV > 0 && FV <= Version;
786  }
787  return ExtensionsOk;
788 }
789 
791  switch (Format) {
792  case DWARF32:
793  return "DWARF32";
794  case DWARF64:
795  return "DWARF64";
796  }
797  return StringRef();
798 }
799 
801  return FormatString(IsDWARF64 ? DWARF64 : DWARF32);
802 }
803 
805  switch (RLE) {
806  default:
807  return StringRef();
808 #define HANDLE_DW_RLE(ID, NAME) \
809  case DW_RLE_##NAME: \
810  return "DW_RLE_" #NAME;
811 #include "llvm/BinaryFormat/Dwarf.def"
812  }
813 }
814 
816 constexpr char llvm::dwarf::EnumTraits<Form>::Type[];
817 constexpr char llvm::dwarf::EnumTraits<Index>::Type[];
818 constexpr char llvm::dwarf::EnumTraits<Tag>::Type[];
llvm::StringSwitch::Case
StringSwitch & Case(StringLiteral S, T Value)
Definition: StringSwitch.h:67
llvm::dwarf::AttributeEncodingString
StringRef AttributeEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:197
llvm::dwarf::AttributeEncodingVendor
unsigned AttributeEncodingVendor(TypeKind E)
Definition: Dwarf.cpp:227
llvm::dwarf::DW_VIS_qualified
@ DW_VIS_qualified
Definition: Dwarf.h:185
llvm::dwarf::DW_ATOM_null
@ DW_ATOM_null
Definition: Dwarf.h:503
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::dwarf::GIEK_TYPE
@ GIEK_TYPE
Definition: Dwarf.h:528
llvm::dwarf::MacroString
StringRef MacroString(unsigned Encoding)
Definition: Dwarf.cpp:486
llvm::dwarf::DW_ACCESS_protected
@ DW_ACCESS_protected
Definition: Dwarf.h:177
llvm::StringSwitch::Default
LLVM_NODISCARD R Default(T Value)
Definition: StringSwitch.h:181
llvm::dwarf::DW_ATOM_die_offset
@ DW_ATOM_die_offset
Marker as the end of a list of atoms.
Definition: Dwarf.h:504
llvm::dwarf::DW_ORD_col_major
@ DW_ORD_col_major
Definition: Dwarf.h:349
llvm::dwarf::GIEL_EXTERNAL
@ GIEL_EXTERNAL
Definition: Dwarf.h:537
llvm::dwarf::GDBIndexEntryLinkageString
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
Definition: Dwarf.cpp:629
llvm::dwarf::Form
Form
Definition: Dwarf.h:131
ErrorHandling.h
llvm::dwarf::getVirtuality
unsigned getVirtuality(StringRef VirtualityString)
Definition: Dwarf.cpp:319
llvm::dwarf::DW_OP_LLVM_tag_offset
@ DW_OP_LLVM_tag_offset
Only used in LLVM metadata.
Definition: Dwarf.h:144
llvm::dwarf::DW_ATOM_qual_name_hash
@ DW_ATOM_qual_name_hash
Definition: Dwarf.h:511
llvm::dwarf::DW_VIS_exported
@ DW_VIS_exported
Definition: Dwarf.h:184
llvm::dwarf::DW_INL_not_inlined
@ DW_INL_not_inlined
Definition: Dwarf.h:340
llvm::dwarf::FormParams::AddrSize
uint8_t AddrSize
Definition: Dwarf.h:650
llvm::dwarf::RangeListEncodingString
StringRef RangeListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:514
llvm::dwarf::DW_CHILDREN_yes
@ DW_CHILDREN_yes
Definition: Dwarf.h:430
llvm::dwarf::FormVersion
unsigned FormVersion(Form F)
Definition: Dwarf.cpp:116
llvm::Optional< unsigned >
llvm::dwarf::GIEK_VARIABLE
@ GIEK_VARIABLE
Definition: Dwarf.h:529
llvm::dwarf::GDBIndexEntryKind
GDBIndexEntryKind
Definition: Dwarf.h:526
llvm::dwarf::DW_INL_declared_not_inlined
@ DW_INL_declared_not_inlined
Definition: Dwarf.h:342
llvm::dwarf::AttributeVendor
unsigned AttributeVendor(Attribute A)
Definition: Dwarf.cpp:94
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:104
llvm::dwarf::getCallingConvention
unsigned getCallingConvention(StringRef LanguageString)
Definition: Dwarf.cpp:404
llvm::dwarf::VirtualityString
StringRef VirtualityString(unsigned Virtuality)
Definition: Dwarf.cpp:308
llvm::dwarf::GIEL_STATIC
@ GIEL_STATIC
Definition: Dwarf.h:537
llvm::dwarf::IndexString
StringRef IndexString(unsigned Idx)
Definition: Dwarf.cpp:683
llvm::dwarf::Attribute
Attribute
Attributes.
Definition: Dwarf.h:124
llvm::dwarf::AccessibilityString
StringRef AccessibilityString(unsigned Access)
Definition: Dwarf.cpp:270
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::dwarf::GnuMacroString
StringRef GnuMacroString(unsigned Encoding)
Definition: Dwarf.cpp:497
llvm::dwarf::DW_MACINFO_end_file
@ DW_MACINFO_end_file
Definition: Dwarf.h:384
llvm::dwarf::TagVendor
unsigned TagVendor(Tag T)
Definition: Dwarf.cpp:51
llvm::dwarf::AtomTypeString
StringRef AtomTypeString(unsigned Atom)
Definition: Dwarf.cpp:587
llvm::dwarf::CallFrameString
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
Definition: Dwarf.cpp:536
llvm::dwarf::GIEK_UNUSED6
@ GIEK_UNUSED6
Definition: Dwarf.h:533
llvm::dwarf::LNExtendedString
StringRef LNExtendedString(unsigned Encoding)
Definition: Dwarf.cpp:446
llvm::Triple::ArchType
ArchType
Definition: Triple.h:47
llvm::dwarf::LanguageString
StringRef LanguageString(unsigned Language)
Definition: Dwarf.cpp:327
llvm::dwarf::AttributeValueString
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
Definition: Dwarf.cpp:639
llvm::dwarf::DW_DS_trailing_overpunch
@ DW_DS_trailing_overpunch
Definition: Dwarf.h:161
llvm::dwarf::DW_ATOM_die_tag
@ DW_ATOM_die_tag
Definition: Dwarf.h:507
llvm::AMDGPU::HSAMD::Kernel::Key::Language
constexpr char Language[]
Key for Kernel::Metadata::mLanguage.
Definition: AMDGPUMetadata.h:383
llvm::dwarf::DW_ATOM_type_type_flags
@ DW_ATOM_type_type_flags
Definition: Dwarf.h:510
llvm::dwarf::getTag
unsigned getTag(StringRef TagString)
Definition: Dwarf.cpp:32
llvm::dwarf::DW_ATOM_cu_offset
@ DW_ATOM_cu_offset
Definition: Dwarf.h:505
llvm::dwarf::LanguageVersion
unsigned LanguageVersion(SourceLanguage L)
Definition: Dwarf.cpp:346
llvm::dwarf::LanguageLowerBound
Optional< unsigned > LanguageLowerBound(SourceLanguage L)
Definition: Dwarf.cpp:368
llvm::dwarf::FormatString
StringRef FormatString(DwarfFormat Format)
Definition: Dwarf.cpp:790
llvm::dwarf::VisibilityString
StringRef VisibilityString(unsigned Visibility)
Definition: Dwarf.cpp:296
llvm::IndexedInstrProf::Version
const uint64_t Version
Definition: InstrProf.h:991
llvm::dwarf::GDBIndexEntryKindString
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
Definition: Dwarf.cpp:606
llvm::dwarf::DwarfFormat
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
Definition: Dwarf.h:92
llvm::None
const NoneType None
Definition: None.h:23
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::dwarf::FormEncodingString
StringRef FormEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:105
llvm::dwarf::DW_ORD_row_major
@ DW_ORD_row_major
Definition: Dwarf.h:348
llvm::dwarf::DW_OP_LLVM_entry_value
@ DW_OP_LLVM_entry_value
Only used in LLVM metadata.
Definition: Dwarf.h:145
llvm::dwarf::DW_INL_inlined
@ DW_INL_inlined
Definition: Dwarf.h:341
llvm::dwarf::getLanguage
unsigned getLanguage(StringRef LanguageString)
Definition: Dwarf.cpp:338
llvm::dwarf::DW_ID_down_case
@ DW_ID_down_case
Definition: Dwarf.h:326
llvm::dwarf::TagVersion
unsigned TagVersion(Tag T)
Definition: Dwarf.cpp:40
llvm::dwarf::DW_VIS_local
@ DW_VIS_local
Definition: Dwarf.h:183
llvm::dwarf::DefaultedMemberString
StringRef DefaultedMemberString(unsigned DefaultedEncodings)
Definition: Dwarf.cpp:283
llvm::dwarf::DW_ACCESS_public
@ DW_ACCESS_public
Definition: Dwarf.h:176
llvm::dwarf::FormParams
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
Definition: Dwarf.h:648
llvm::dwarf::AttributeVersion
unsigned AttributeVersion(Attribute A)
Definition: Dwarf.cpp:83
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::dwarf::FormParams::getDwarfOffsetByteSize
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
Definition: Dwarf.h:663
llvm::dwarf::FormVendor
unsigned FormVendor(Form F)
Definition: Dwarf.cpp:127
llvm::dwarf::GIEK_UNUSED5
@ GIEK_UNUSED5
Definition: Dwarf.h:532
llvm::dwarf::DW_END_lo_user
@ DW_END_lo_user
Definition: Dwarf.h:170
Triple.h
llvm::dwarf::DW_INL_declared_inlined
@ DW_INL_declared_inlined
Definition: Dwarf.h:343
llvm::dwarf::SourceLanguage
SourceLanguage
Definition: Dwarf.h:200
llvm::dwarf::DW_OP_LLVM_arg
@ DW_OP_LLVM_arg
Only used in LLVM metadata.
Definition: Dwarf.h:147
llvm::dwarf::getAttributeEncoding
unsigned getAttributeEncoding(StringRef EncodingString)
Definition: Dwarf.cpp:208
llvm::dwarf::ArrayOrderString
StringRef ArrayOrderString(unsigned Order)
Definition: Dwarf.cpp:425
llvm::dwarf::CaseString
StringRef CaseString(unsigned Case)
Definition: Dwarf.cpp:379
llvm::dwarf::DW_OP_LLVM_fragment
@ DW_OP_LLVM_fragment
Only used in LLVM metadata.
Definition: Dwarf.h:142
llvm::dwarf::DW_DS_unsigned
@ DW_DS_unsigned
Definition: Dwarf.h:159
llvm::dwarf::DW_OP_LLVM_implicit_pointer
@ DW_OP_LLVM_implicit_pointer
Only used in LLVM metadata.
Definition: Dwarf.h:146
llvm::dwarf::DW_TAG_invalid
@ DW_TAG_invalid
LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def).
Definition: Dwarf.h:48
llvm::dwarf::DW_ACCESS_private
@ DW_ACCESS_private
Definition: Dwarf.h:178
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
Dwarf.h
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::dwarf::LanguageVendor
unsigned LanguageVendor(SourceLanguage L)
Definition: Dwarf.cpp:357
llvm::dwarf::DW_MACINFO_vendor_ext
@ DW_MACINFO_vendor_ext
Definition: Dwarf.h:385
llvm::dwarf::ApplePropertyString
StringRef ApplePropertyString(unsigned)
Definition: Dwarf.cpp:565
llvm::dwarf::AtomValueString
StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
Definition: Dwarf.cpp:672
llvm::dwarf::DW_MACINFO_define
@ DW_MACINFO_define
Definition: Dwarf.h:381
llvm::dwarf::ChildrenString
StringRef ChildrenString(unsigned Children)
Definition: Dwarf.cpp:62
llvm::dwarf::GIEK_UNUSED7
@ GIEK_UNUSED7
Definition: Dwarf.h:534
llvm::dwarf::ConventionString
StringRef ConventionString(unsigned Convention)
Definition: Dwarf.cpp:393
llvm::dwarf::getFixedFormByteSize
Optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
Definition: Dwarf.cpp:694
llvm::dwarf::GIEK_FUNCTION
@ GIEK_FUNCTION
Definition: Dwarf.h:530
llvm::dwarf::TypeKind
TypeKind
Definition: Dwarf.h:150
llvm::dwarf::getOperationEncoding
unsigned getOperationEncoding(StringRef OperationEncodingString)
Definition: Dwarf.cpp:161
uint16_t
llvm::dwarf::DW_END_hi_user
@ DW_END_hi_user
Definition: Dwarf.h:171
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:314
llvm::dwarf::GIEK_NONE
@ GIEK_NONE
Definition: Dwarf.h:527
llvm::dwarf::DW_DS_leading_separate
@ DW_DS_leading_separate
Definition: Dwarf.h:162
llvm::dwarf::DW_MACINFO_start_file
@ DW_MACINFO_start_file
Definition: Dwarf.h:383
llvm::dwarf::EndianityString
StringRef EndianityString(unsigned Endian)
Definition: Dwarf.cpp:254
llvm::dwarf::DW_VIRTUALITY_invalid
@ DW_VIRTUALITY_invalid
Virtuality for invalid results.
Definition: Dwarf.h:49
llvm::dwarf::DW_DS_trailing_separate
@ DW_DS_trailing_separate
Definition: Dwarf.h:163
llvm::dwarf::DW_MACINFO_undef
@ DW_MACINFO_undef
Definition: Dwarf.h:382
StringSwitch.h
llvm::dwarf::DWARF_VENDOR_DWARF
@ DWARF_VENDOR_DWARF
Identifiers we use to distinguish vendor extensions.
Definition: Dwarf.h:70
llvm::dwarf::DW_ID_case_insensitive
@ DW_ID_case_insensitive
Definition: Dwarf.h:327
llvm::dwarf::DW_OP_LLVM_convert
@ DW_OP_LLVM_convert
Only used in LLVM metadata.
Definition: Dwarf.h:143
llvm::dwarf::LNStandardString
StringRef LNStandardString(unsigned Standard)
Definition: Dwarf.cpp:435
llvm::dwarf::isValidFormForVersion
bool isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk=true)
Tells whether the specified form is defined in the specified version, or is an extension if extension...
Definition: Dwarf.cpp:781
llvm::dwarf::DW_CHILDREN_no
@ DW_CHILDREN_no
Definition: Dwarf.h:429
llvm::dwarf::OperationVendor
unsigned OperationVendor(LocationAtom O)
Definition: Dwarf.cpp:186
llvm::dwarf::MacinfoString
StringRef MacinfoString(unsigned Encoding)
Definition: Dwarf.cpp:457
llvm::dwarf::DW_MACINFO_invalid
@ DW_MACINFO_invalid
Macinfo type for invalid results.
Definition: Dwarf.h:50
llvm::dwarf::DW_ID_case_sensitive
@ DW_ID_case_sensitive
Definition: Dwarf.h:324
llvm::dwarf::getMacro
unsigned getMacro(StringRef MacroString)
Definition: Dwarf.cpp:508
llvm::dwarf::GIEK_OTHER
@ GIEK_OTHER
Definition: Dwarf.h:531
llvm::dwarf::OperationVersion
unsigned OperationVersion(LocationAtom O)
Definition: Dwarf.cpp:175
llvm::dwarf::RLEString
StringRef RLEString(unsigned RLE)
Definition: Dwarf.cpp:804
llvm::StringSwitch
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:42
llvm::dwarf::InlineCodeString
StringRef InlineCodeString(unsigned Code)
Definition: Dwarf.cpp:411
llvm::dwarf::DWARF64
@ DWARF64
Definition: Dwarf.h:92
llvm::dwarf::DW_ATOM_type_flags
@ DW_ATOM_type_flags
Definition: Dwarf.h:508
llvm::dwarf::TagString
StringRef TagString(unsigned Tag)
Definition: Dwarf.cpp:21
llvm::dwarf::DW_DS_leading_overpunch
@ DW_DS_leading_overpunch
Definition: Dwarf.h:160
llvm::dwarf::DecimalSignString
StringRef DecimalSignString(unsigned Sign)
Definition: Dwarf.cpp:238
llvm::dwarf::AttributeEncodingVersion
unsigned AttributeEncodingVersion(TypeKind E)
Definition: Dwarf.cpp:216
llvm::dwarf::getMacinfo
unsigned getMacinfo(StringRef MacinfoString)
Definition: Dwarf.cpp:476
llvm::dwarf::UnitTypeString
StringRef UnitTypeString(unsigned)
Definition: Dwarf.cpp:576
llvm::dwarf::GDBIndexEntryLinkage
GDBIndexEntryLinkage
Definition: Dwarf.h:537
llvm::dwarf::AttributeString
StringRef AttributeString(unsigned Attribute)
Definition: Dwarf.cpp:72
llvm::dwarf::DW_ID_up_case
@ DW_ID_up_case
Definition: Dwarf.h:325
llvm::dwarf::OperationEncodingString
StringRef OperationEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:138
llvm::dwarf::LocListEncodingString
StringRef LocListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:525
llvm::dwarf::LocationAtom
LocationAtom
Definition: Dwarf.h:137
llvm::dwarf::DWARF32
@ DWARF32
Definition: Dwarf.h:92
llvm::dwarf::EnumTraits
Definition: Dwarf.h:740
llvm::dwarf::FormParams::getRefAddrByteSize
uint8_t getRefAddrByteSize() const
The definition of the size of form DW_FORM_ref_addr depends on the version.
Definition: Dwarf.h:656