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