LLVM  10.0.0svn
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 
278  switch (Visibility) {
279  case DW_VIS_local:
280  return "DW_VIS_local";
281  case DW_VIS_exported:
282  return "DW_VIS_exported";
283  case DW_VIS_qualified:
284  return "DW_VIS_qualified";
285  }
286  return StringRef();
287 }
288 
290  switch (Virtuality) {
291  default:
292  return StringRef();
293 #define HANDLE_DW_VIRTUALITY(ID, NAME) \
294  case DW_VIRTUALITY_##NAME: \
295  return "DW_VIRTUALITY_" #NAME;
296 #include "llvm/BinaryFormat/Dwarf.def"
297  }
298 }
299 
302 #define HANDLE_DW_VIRTUALITY(ID, NAME) \
303  .Case("DW_VIRTUALITY_" #NAME, DW_VIRTUALITY_##NAME)
304 #include "llvm/BinaryFormat/Dwarf.def"
305  .Default(DW_VIRTUALITY_invalid);
306 }
307 
309  switch (Language) {
310  default:
311  return StringRef();
312 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
313  case DW_LANG_##NAME: \
314  return "DW_LANG_" #NAME;
315 #include "llvm/BinaryFormat/Dwarf.def"
316  }
317 }
318 
321 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
322  .Case("DW_LANG_" #NAME, DW_LANG_##NAME)
323 #include "llvm/BinaryFormat/Dwarf.def"
324  .Default(0);
325 }
326 
328  switch (Lang) {
329  default:
330  return 0;
331 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
332  case DW_LANG_##NAME: \
333  return VERSION;
334 #include "llvm/BinaryFormat/Dwarf.def"
335  }
336 }
337 
339  switch (Lang) {
340  default:
341  return 0;
342 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
343  case DW_LANG_##NAME: \
344  return DWARF_VENDOR_##VENDOR;
345 #include "llvm/BinaryFormat/Dwarf.def"
346  }
347 }
348 
350  switch (Lang) {
351  default:
352  return None;
353 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
354  case DW_LANG_##NAME: \
355  return LOWER_BOUND;
356 #include "llvm/BinaryFormat/Dwarf.def"
357  }
358 }
359 
361  switch (Case) {
363  return "DW_ID_case_sensitive";
364  case DW_ID_up_case:
365  return "DW_ID_up_case";
366  case DW_ID_down_case:
367  return "DW_ID_down_case";
369  return "DW_ID_case_insensitive";
370  }
371  return StringRef();
372 }
373 
375  switch (CC) {
376  default:
377  return StringRef();
378 #define HANDLE_DW_CC(ID, NAME) \
379  case DW_CC_##NAME: \
380  return "DW_CC_" #NAME;
381 #include "llvm/BinaryFormat/Dwarf.def"
382  }
383 }
384 
386  return StringSwitch<unsigned>(CCString)
387 #define HANDLE_DW_CC(ID, NAME) .Case("DW_CC_" #NAME, DW_CC_##NAME)
388 #include "llvm/BinaryFormat/Dwarf.def"
389  .Default(0);
390 }
391 
393  switch (Code) {
394  case DW_INL_not_inlined:
395  return "DW_INL_not_inlined";
396  case DW_INL_inlined:
397  return "DW_INL_inlined";
399  return "DW_INL_declared_not_inlined";
401  return "DW_INL_declared_inlined";
402  }
403  return StringRef();
404 }
405 
407  switch (Order) {
408  case DW_ORD_row_major:
409  return "DW_ORD_row_major";
410  case DW_ORD_col_major:
411  return "DW_ORD_col_major";
412  }
413  return StringRef();
414 }
415 
417  switch (Standard) {
418  default:
419  return StringRef();
420 #define HANDLE_DW_LNS(ID, NAME) \
421  case DW_LNS_##NAME: \
422  return "DW_LNS_" #NAME;
423 #include "llvm/BinaryFormat/Dwarf.def"
424  }
425 }
426 
428  switch (Encoding) {
429  default:
430  return StringRef();
431 #define HANDLE_DW_LNE(ID, NAME) \
432  case DW_LNE_##NAME: \
433  return "DW_LNE_" #NAME;
434 #include "llvm/BinaryFormat/Dwarf.def"
435  }
436 }
437 
439  switch (Encoding) {
440  // Macinfo Type Encodings
441  case DW_MACINFO_define:
442  return "DW_MACINFO_define";
443  case DW_MACINFO_undef:
444  return "DW_MACINFO_undef";
446  return "DW_MACINFO_start_file";
447  case DW_MACINFO_end_file:
448  return "DW_MACINFO_end_file";
450  return "DW_MACINFO_vendor_ext";
451  case DW_MACINFO_invalid:
452  return "DW_MACINFO_invalid";
453  }
454  return StringRef();
455 }
456 
459  .Case("DW_MACINFO_define", DW_MACINFO_define)
460  .Case("DW_MACINFO_undef", DW_MACINFO_undef)
461  .Case("DW_MACINFO_start_file", DW_MACINFO_start_file)
462  .Case("DW_MACINFO_end_file", DW_MACINFO_end_file)
463  .Case("DW_MACINFO_vendor_ext", DW_MACINFO_vendor_ext)
465 }
466 
468  switch (Encoding) {
469  default:
470  return StringRef();
471 #define HANDLE_DW_RLE(ID, NAME) \
472  case DW_RLE_##NAME: \
473  return "DW_RLE_" #NAME;
474 #include "llvm/BinaryFormat/Dwarf.def"
475  }
476 }
477 
479  switch (Encoding) {
480  default:
481  return StringRef();
482 #define HANDLE_DW_LLE(ID, NAME) \
483  case DW_LLE_##NAME: \
484  return "DW_LLE_" #NAME;
485 #include "llvm/BinaryFormat/Dwarf.def"
486  }
487 }
488 
490  Triple::ArchType Arch) {
491  assert(Arch != llvm::Triple::ArchType::UnknownArch);
492 #define SELECT_AARCH64 (Arch == llvm::Triple::aarch64_be || Arch == llvm::Triple::aarch64)
493 #define SELECT_MIPS64 Arch == llvm::Triple::mips64
494 #define SELECT_SPARC (Arch == llvm::Triple::sparc || Arch == llvm::Triple::sparcv9)
495 #define SELECT_X86 (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
496 #define HANDLE_DW_CFA(ID, NAME)
497 #define HANDLE_DW_CFA_PRED(ID, NAME, PRED) \
498  if (ID == Encoding && PRED) \
499  return "DW_CFA_" #NAME;
500 #include "llvm/BinaryFormat/Dwarf.def"
501 
502  switch (Encoding) {
503  default:
504  return StringRef();
505 #define HANDLE_DW_CFA_PRED(ID, NAME, PRED)
506 #define HANDLE_DW_CFA(ID, NAME) \
507  case DW_CFA_##NAME: \
508  return "DW_CFA_" #NAME;
509 #include "llvm/BinaryFormat/Dwarf.def"
510 
511 #undef SELECT_X86
512 #undef SELECT_SPARC
513 #undef SELECT_MIPS64
514 #undef SELECT_AARCH64
515  }
516 }
517 
519  switch (Prop) {
520  default:
521  return StringRef();
522 #define HANDLE_DW_APPLE_PROPERTY(ID, NAME) \
523  case DW_APPLE_PROPERTY_##NAME: \
524  return "DW_APPLE_PROPERTY_" #NAME;
525 #include "llvm/BinaryFormat/Dwarf.def"
526  }
527 }
528 
530  switch (UT) {
531  default:
532  return StringRef();
533 #define HANDLE_DW_UT(ID, NAME) \
534  case DW_UT_##NAME: \
535  return "DW_UT_" #NAME;
536 #include "llvm/BinaryFormat/Dwarf.def"
537  }
538 }
539 
541  switch (AT) {
542  case dwarf::DW_ATOM_null:
543  return "DW_ATOM_null";
545  return "DW_ATOM_die_offset";
546  case DW_ATOM_cu_offset:
547  return "DW_ATOM_cu_offset";
548  case DW_ATOM_die_tag:
549  return "DW_ATOM_die_tag";
550  case DW_ATOM_type_flags:
552  return "DW_ATOM_type_flags";
554  return "DW_ATOM_qual_name_hash";
555  }
556  return StringRef();
557 }
558 
560  switch (Kind) {
561  case GIEK_NONE:
562  return "NONE";
563  case GIEK_TYPE:
564  return "TYPE";
565  case GIEK_VARIABLE:
566  return "VARIABLE";
567  case GIEK_FUNCTION:
568  return "FUNCTION";
569  case GIEK_OTHER:
570  return "OTHER";
571  case GIEK_UNUSED5:
572  return "UNUSED5";
573  case GIEK_UNUSED6:
574  return "UNUSED6";
575  case GIEK_UNUSED7:
576  return "UNUSED7";
577  }
578  llvm_unreachable("Unknown GDBIndexEntryKind value");
579 }
580 
581 StringRef
583  switch (Linkage) {
584  case GIEL_EXTERNAL:
585  return "EXTERNAL";
586  case GIEL_STATIC:
587  return "STATIC";
588  }
589  llvm_unreachable("Unknown GDBIndexEntryLinkage value");
590 }
591 
592 StringRef llvm::dwarf::AttributeValueString(uint16_t Attr, unsigned Val) {
593  switch (Attr) {
594  case DW_AT_accessibility:
595  return AccessibilityString(Val);
596  case DW_AT_virtuality:
597  return VirtualityString(Val);
598  case DW_AT_language:
599  return LanguageString(Val);
600  case DW_AT_encoding:
601  return AttributeEncodingString(Val);
602  case DW_AT_decimal_sign:
603  return DecimalSignString(Val);
604  case DW_AT_endianity:
605  return EndianityString(Val);
606  case DW_AT_visibility:
607  return VisibilityString(Val);
608  case DW_AT_identifier_case:
609  return CaseString(Val);
610  case DW_AT_calling_convention:
611  return ConventionString(Val);
612  case DW_AT_inline:
613  return InlineCodeString(Val);
614  case DW_AT_ordering:
615  return ArrayOrderString(Val);
616  case DW_AT_APPLE_runtime_class:
617  return LanguageString(Val);
618  }
619 
620  return StringRef();
621 }
622 
623 StringRef llvm::dwarf::AtomValueString(uint16_t Atom, unsigned Val) {
624  switch (Atom) {
625  case DW_ATOM_null:
626  return "NULL";
627  case DW_ATOM_die_tag:
628  return TagString(Val);
629  }
630 
631  return StringRef();
632 }
633 
635  switch (Idx) {
636  default:
637  return StringRef();
638 #define HANDLE_DW_IDX(ID, NAME) \
639  case DW_IDX_##NAME: \
640  return "DW_IDX_" #NAME;
641 #include "llvm/BinaryFormat/Dwarf.def"
642  }
643 }
644 
646  FormParams Params) {
647  switch (Form) {
648  case DW_FORM_addr:
649  if (Params)
650  return Params.AddrSize;
651  return None;
652 
653  case DW_FORM_block: // ULEB128 length L followed by L bytes.
654  case DW_FORM_block1: // 1 byte length L followed by L bytes.
655  case DW_FORM_block2: // 2 byte length L followed by L bytes.
656  case DW_FORM_block4: // 4 byte length L followed by L bytes.
657  case DW_FORM_string: // C-string with null terminator.
658  case DW_FORM_sdata: // SLEB128.
659  case DW_FORM_udata: // ULEB128.
660  case DW_FORM_ref_udata: // ULEB128.
661  case DW_FORM_indirect: // ULEB128.
662  case DW_FORM_exprloc: // ULEB128 length L followed by L bytes.
663  case DW_FORM_strx: // ULEB128.
664  case DW_FORM_addrx: // ULEB128.
665  case DW_FORM_loclistx: // ULEB128.
666  case DW_FORM_rnglistx: // ULEB128.
667  case DW_FORM_GNU_addr_index: // ULEB128.
668  case DW_FORM_GNU_str_index: // ULEB128.
669  return None;
670 
671  case DW_FORM_ref_addr:
672  if (Params)
673  return Params.getRefAddrByteSize();
674  return None;
675 
676  case DW_FORM_flag:
677  case DW_FORM_data1:
678  case DW_FORM_ref1:
679  case DW_FORM_strx1:
680  case DW_FORM_addrx1:
681  return 1;
682 
683  case DW_FORM_data2:
684  case DW_FORM_ref2:
685  case DW_FORM_strx2:
686  case DW_FORM_addrx2:
687  return 2;
688 
689  case DW_FORM_strx3:
690  return 3;
691 
692  case DW_FORM_data4:
693  case DW_FORM_ref4:
694  case DW_FORM_ref_sup4:
695  case DW_FORM_strx4:
696  case DW_FORM_addrx4:
697  return 4;
698 
699  case DW_FORM_strp:
700  case DW_FORM_GNU_ref_alt:
701  case DW_FORM_GNU_strp_alt:
702  case DW_FORM_line_strp:
703  case DW_FORM_sec_offset:
704  case DW_FORM_strp_sup:
705  if (Params)
706  return Params.getDwarfOffsetByteSize();
707  return None;
708 
709  case DW_FORM_data8:
710  case DW_FORM_ref8:
711  case DW_FORM_ref_sig8:
712  case DW_FORM_ref_sup8:
713  return 8;
714 
715  case DW_FORM_flag_present:
716  return 0;
717 
718  case DW_FORM_data16:
719  return 16;
720 
721  case DW_FORM_implicit_const:
722  // The implicit value is stored in the abbreviation as a SLEB128, and
723  // there no data in debug info.
724  return 0;
725 
726  default:
727  break;
728  }
729  return None;
730 }
731 
733  bool ExtensionsOk) {
734  if (FormVendor(F) == DWARF_VENDOR_DWARF) {
735  unsigned FV = FormVersion(F);
736  return FV > 0 && FV <= Version;
737  }
738  return ExtensionsOk;
739 }
740 
742 constexpr char llvm::dwarf::EnumTraits<Form>::Type[];
743 constexpr char llvm::dwarf::EnumTraits<Index>::Type[];
744 constexpr char llvm::dwarf::EnumTraits<Tag>::Type[];
const NoneType None
Definition: None.h:23
LocationAtom
Definition: Dwarf.h:115
unsigned FormVersion(Form F)
Definition: Dwarf.cpp:116
StringRef ApplePropertyString(unsigned)
Definition: Dwarf.cpp:518
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
Definition: Dwarf.h:536
StringRef IndexString(unsigned Idx)
Definition: Dwarf.cpp:634
This class represents lattice values for constants.
Definition: AllocatorList.h:23
StringRef AtomTypeString(unsigned Atom)
Definition: Dwarf.cpp:540
unsigned FormVendor(Form F)
Definition: Dwarf.cpp:127
#define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR)
Attribute
Attributes.
Definition: Dwarf.h:102
StringRef LNExtendedString(unsigned Encoding)
Definition: Dwarf.cpp:427
StringRef LNStandardString(unsigned Standard)
Definition: Dwarf.cpp:416
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:544
Only used in LLVM metadata.
Definition: Dwarf.h:121
GDBIndexEntryKind
Definition: Dwarf.h:432
F(f)
Optional< unsigned > LanguageLowerBound(SourceLanguage L)
Definition: Dwarf.cpp:349
unsigned getVirtuality(StringRef VirtualityString)
Definition: Dwarf.cpp:300
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:489
#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR)
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:120
unsigned LanguageVendor(SourceLanguage L)
Definition: Dwarf.cpp:338
StringRef AttributeString(unsigned Attribute)
Definition: Dwarf.cpp:72
StringRef LanguageString(unsigned Language)
Definition: Dwarf.cpp:308
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:592
unsigned LanguageVersion(SourceLanguage L)
Definition: Dwarf.cpp:327
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:42
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
Definition: Dwarf.cpp:559
#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:385
Only used in LLVM metadata.
Definition: Dwarf.h:122
SourceLanguage
Definition: Dwarf.h:176
unsigned getOperationEncoding(StringRef OperationEncodingString)
Definition: Dwarf.cpp:157
StringRef ArrayOrderString(unsigned Order)
Definition: Dwarf.cpp:406
unsigned OperationVersion(LocationAtom O)
Definition: Dwarf.cpp:169
Only used in LLVM metadata.
Definition: Dwarf.h:123
#define HANDLE_DW_CC(ID, NAME)
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
Definition: Dwarf.cpp:582
unsigned getLanguage(StringRef LanguageString)
Definition: Dwarf.cpp:319
StringRef RangeListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:467
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef VirtualityString(unsigned Virtuality)
Definition: Dwarf.cpp:289
StringRef OperationEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:138
unsigned getTag(StringRef TagString)
Definition: Dwarf.cpp:32
StringRef CaseString(unsigned Case)
Definition: Dwarf.cpp:360
unsigned AttributeVersion(Attribute A)
Definition: Dwarf.cpp:83
unsigned AttributeEncodingVersion(TypeKind E)
Definition: Dwarf.cpp:210
StringRef VisibilityString(unsigned Visibility)
Definition: Dwarf.cpp:277
This file contains constants used for implementing Dwarf debug support.
StringRef UnitTypeString(unsigned)
Definition: Dwarf.cpp:529
StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
Definition: Dwarf.cpp:623
Optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
Definition: Dwarf.cpp:645
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:392
StringRef ConventionString(unsigned Convention)
Definition: Dwarf.cpp:374
unsigned getMacinfo(StringRef MacinfoString)
Definition: Dwarf.cpp:457
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:732
StringRef LocListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:478
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
unsigned getAttributeEncoding(StringRef EncodingString)
Definition: Dwarf.cpp:202
GDBIndexEntryLinkage
Definition: Dwarf.h:443
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
StringRef MacinfoString(unsigned Encoding)
Definition: Dwarf.cpp:438
Marker as the end of a list of atoms.
Definition: Dwarf.h:410
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
Definition: Dwarf.h:551
const uint64_t Version
Definition: InstrProf.h:980