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