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