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