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