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 (lname) {
416#define HANDLE_DW_LNAME(ID, NAME, DESC, LOWER_BOUND) \
417 case DW_LNAME_##NAME: \
418 return DESC;
419#include "llvm/BinaryFormat/Dwarf.def"
420 }
421 return "Unknown";
422}
423
425 switch (Case) {
427 return "DW_ID_case_sensitive";
428 case DW_ID_up_case:
429 return "DW_ID_up_case";
430 case DW_ID_down_case:
431 return "DW_ID_down_case";
433 return "DW_ID_case_insensitive";
434 }
435 return StringRef();
436}
437
439 switch (CC) {
440 default:
441 return StringRef();
442#define HANDLE_DW_CC(ID, NAME) \
443 case DW_CC_##NAME: \
444 return "DW_CC_" #NAME;
445#include "llvm/BinaryFormat/Dwarf.def"
446 }
447}
448
450 return StringSwitch<unsigned>(CCString)
451#define HANDLE_DW_CC(ID, NAME) .Case("DW_CC_" #NAME, DW_CC_##NAME)
452#include "llvm/BinaryFormat/Dwarf.def"
453 .Default(0);
454}
455
457 switch (Code) {
459 return "DW_INL_not_inlined";
460 case DW_INL_inlined:
461 return "DW_INL_inlined";
463 return "DW_INL_declared_not_inlined";
465 return "DW_INL_declared_inlined";
466 }
467 return StringRef();
468}
469
471 switch (Order) {
472 case DW_ORD_row_major:
473 return "DW_ORD_row_major";
474 case DW_ORD_col_major:
475 return "DW_ORD_col_major";
476 }
477 return StringRef();
478}
479
481 switch (Standard) {
482 default:
483 return StringRef();
484#define HANDLE_DW_LNS(ID, NAME) \
485 case DW_LNS_##NAME: \
486 return "DW_LNS_" #NAME;
487#include "llvm/BinaryFormat/Dwarf.def"
488 }
489}
490
492 switch (Encoding) {
493 default:
494 return StringRef();
495#define HANDLE_DW_LNE(ID, NAME) \
496 case DW_LNE_##NAME: \
497 return "DW_LNE_" #NAME;
498#include "llvm/BinaryFormat/Dwarf.def"
499 }
500}
501
503 switch (Encoding) {
504 // Macinfo Type Encodings
506 return "DW_MACINFO_define";
507 case DW_MACINFO_undef:
508 return "DW_MACINFO_undef";
510 return "DW_MACINFO_start_file";
512 return "DW_MACINFO_end_file";
514 return "DW_MACINFO_vendor_ext";
516 return "DW_MACINFO_invalid";
517 }
518 return StringRef();
519}
520
523 .Case("DW_MACINFO_define", DW_MACINFO_define)
524 .Case("DW_MACINFO_undef", DW_MACINFO_undef)
525 .Case("DW_MACINFO_start_file", DW_MACINFO_start_file)
526 .Case("DW_MACINFO_end_file", DW_MACINFO_end_file)
527 .Case("DW_MACINFO_vendor_ext", DW_MACINFO_vendor_ext)
529}
530
532 switch (Encoding) {
533 default:
534 return StringRef();
535#define HANDLE_DW_MACRO(ID, NAME) \
536 case DW_MACRO_##NAME: \
537 return "DW_MACRO_" #NAME;
538#include "llvm/BinaryFormat/Dwarf.def"
539 }
540}
541
543 switch (Encoding) {
544 default:
545 return StringRef();
546#define HANDLE_DW_MACRO_GNU(ID, NAME) \
547 case DW_MACRO_GNU_##NAME: \
548 return "DW_MACRO_GNU_" #NAME;
549#include "llvm/BinaryFormat/Dwarf.def"
550 }
551}
552
555#define HANDLE_DW_MACRO(ID, NAME) .Case("DW_MACRO_" #NAME, ID)
556#include "llvm/BinaryFormat/Dwarf.def"
558}
560 switch (Encoding) {
561 default:
562 return StringRef();
563#define HANDLE_DW_RLE(ID, NAME) \
564 case DW_RLE_##NAME: \
565 return "DW_RLE_" #NAME;
566#include "llvm/BinaryFormat/Dwarf.def"
567 }
568}
569
571 switch (Encoding) {
572 default:
573 return StringRef();
574#define HANDLE_DW_LLE(ID, NAME) \
575 case DW_LLE_##NAME: \
576 return "DW_LLE_" #NAME;
577#include "llvm/BinaryFormat/Dwarf.def"
578 }
579}
580
582 Triple::ArchType Arch) {
584#define SELECT_AARCH64 (Arch == llvm::Triple::aarch64_be || Arch == llvm::Triple::aarch64)
585#define SELECT_MIPS64 Arch == llvm::Triple::mips64
586#define SELECT_SPARC (Arch == llvm::Triple::sparc || Arch == llvm::Triple::sparcv9)
587#define SELECT_X86 (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
588#define HANDLE_DW_CFA(ID, NAME)
589#define HANDLE_DW_CFA_PRED(ID, NAME, PRED) \
590 if (ID == Encoding && PRED) \
591 return "DW_CFA_" #NAME;
592#include "llvm/BinaryFormat/Dwarf.def"
593
594 switch (Encoding) {
595 default:
596 return StringRef();
597#define HANDLE_DW_CFA_PRED(ID, NAME, PRED)
598#define HANDLE_DW_CFA(ID, NAME) \
599 case DW_CFA_##NAME: \
600 return "DW_CFA_" #NAME;
601#include "llvm/BinaryFormat/Dwarf.def"
602
603#undef SELECT_X86
604#undef SELECT_SPARC
605#undef SELECT_MIPS64
606#undef SELECT_AARCH64
607 }
608}
609
611 switch (Prop) {
612 default:
613 return StringRef();
614#define HANDLE_DW_APPLE_PROPERTY(ID, NAME) \
615 case DW_APPLE_PROPERTY_##NAME: \
616 return "DW_APPLE_PROPERTY_" #NAME;
617#include "llvm/BinaryFormat/Dwarf.def"
618 }
619}
620
622 switch (UT) {
623 default:
624 return StringRef();
625#define HANDLE_DW_UT(ID, NAME) \
626 case DW_UT_##NAME: \
627 return "DW_UT_" #NAME;
628#include "llvm/BinaryFormat/Dwarf.def"
629 }
630}
631
633 switch (AT) {
635 return "DW_ATOM_null";
637 return "DW_ATOM_die_offset";
639 return "DW_ATOM_cu_offset";
640 case DW_ATOM_die_tag:
641 return "DW_ATOM_die_tag";
644 return "DW_ATOM_type_flags";
646 return "DW_ATOM_qual_name_hash";
647 }
648 return StringRef();
649}
650
652 switch (Kind) {
653 case GIEK_NONE:
654 return "NONE";
655 case GIEK_TYPE:
656 return "TYPE";
657 case GIEK_VARIABLE:
658 return "VARIABLE";
659 case GIEK_FUNCTION:
660 return "FUNCTION";
661 case GIEK_OTHER:
662 return "OTHER";
663 case GIEK_UNUSED5:
664 return "UNUSED5";
665 case GIEK_UNUSED6:
666 return "UNUSED6";
667 case GIEK_UNUSED7:
668 return "UNUSED7";
669 }
670 llvm_unreachable("Unknown GDBIndexEntryKind value");
671}
672
675 switch (Linkage) {
676 case GIEL_EXTERNAL:
677 return "EXTERNAL";
678 case GIEL_STATIC:
679 return "STATIC";
680 }
681 llvm_unreachable("Unknown GDBIndexEntryLinkage value");
682}
683
685 switch (Attr) {
686 case DW_AT_accessibility:
687 return AccessibilityString(Val);
688 case DW_AT_virtuality:
689 return VirtualityString(Val);
690 case DW_AT_language:
691 return LanguageString(Val);
692 case DW_AT_encoding:
693 return AttributeEncodingString(Val);
694 case DW_AT_decimal_sign:
695 return DecimalSignString(Val);
696 case DW_AT_endianity:
697 return EndianityString(Val);
698 case DW_AT_visibility:
699 return VisibilityString(Val);
700 case DW_AT_identifier_case:
701 return CaseString(Val);
702 case DW_AT_calling_convention:
703 return ConventionString(Val);
704 case DW_AT_inline:
705 return InlineCodeString(Val);
706 case DW_AT_ordering:
707 return ArrayOrderString(Val);
708 case DW_AT_APPLE_runtime_class:
709 return LanguageString(Val);
710 case DW_AT_defaulted:
711 return DefaultedMemberString(Val);
712 }
713
714 return StringRef();
715}
716
718 switch (Atom) {
719 case DW_ATOM_null:
720 return "NULL";
721 case DW_ATOM_die_tag:
722 return TagString(Val);
723 }
724
725 return StringRef();
726}
727
729 switch (Idx) {
730 default:
731 return StringRef();
732#define HANDLE_DW_IDX(ID, NAME) \
733 case DW_IDX_##NAME: \
734 return "DW_IDX_" #NAME;
735#include "llvm/BinaryFormat/Dwarf.def"
736 }
737}
738
740 FormParams Params) {
741 switch (Form) {
742 case DW_FORM_addr:
743 if (Params)
744 return Params.AddrSize;
745 return std::nullopt;
746
747 case DW_FORM_block: // ULEB128 length L followed by L bytes.
748 case DW_FORM_block1: // 1 byte length L followed by L bytes.
749 case DW_FORM_block2: // 2 byte length L followed by L bytes.
750 case DW_FORM_block4: // 4 byte length L followed by L bytes.
751 case DW_FORM_string: // C-string with null terminator.
752 case DW_FORM_sdata: // SLEB128.
753 case DW_FORM_udata: // ULEB128.
754 case DW_FORM_ref_udata: // ULEB128.
755 case DW_FORM_indirect: // ULEB128.
756 case DW_FORM_exprloc: // ULEB128 length L followed by L bytes.
757 case DW_FORM_strx: // ULEB128.
758 case DW_FORM_addrx: // ULEB128.
759 case DW_FORM_loclistx: // ULEB128.
760 case DW_FORM_rnglistx: // ULEB128.
761 case DW_FORM_GNU_addr_index: // ULEB128.
762 case DW_FORM_GNU_str_index: // ULEB128.
763 return std::nullopt;
764
765 case DW_FORM_ref_addr:
766 if (Params)
767 return Params.getRefAddrByteSize();
768 return std::nullopt;
769
770 case DW_FORM_flag:
771 case DW_FORM_data1:
772 case DW_FORM_ref1:
773 case DW_FORM_strx1:
774 case DW_FORM_addrx1:
775 return 1;
776
777 case DW_FORM_data2:
778 case DW_FORM_ref2:
779 case DW_FORM_strx2:
780 case DW_FORM_addrx2:
781 return 2;
782
783 case DW_FORM_strx3:
784 case DW_FORM_addrx3:
785 return 3;
786
787 case DW_FORM_data4:
788 case DW_FORM_ref4:
789 case DW_FORM_ref_sup4:
790 case DW_FORM_strx4:
791 case DW_FORM_addrx4:
792 return 4;
793
794 case DW_FORM_strp:
795 case DW_FORM_GNU_ref_alt:
796 case DW_FORM_GNU_strp_alt:
797 case DW_FORM_line_strp:
798 case DW_FORM_sec_offset:
799 case DW_FORM_strp_sup:
800 if (Params)
801 return Params.getDwarfOffsetByteSize();
802 return std::nullopt;
803
804 case DW_FORM_data8:
805 case DW_FORM_ref8:
806 case DW_FORM_ref_sig8:
807 case DW_FORM_ref_sup8:
808 return 8;
809
810 case DW_FORM_flag_present:
811 return 0;
812
813 case DW_FORM_data16:
814 return 16;
815
816 case DW_FORM_implicit_const:
817 // The implicit value is stored in the abbreviation as a SLEB128, and
818 // there no data in debug info.
819 return 0;
820
821 default:
822 break;
823 }
824 return std::nullopt;
825}
826
828 bool ExtensionsOk) {
830 unsigned FV = FormVersion(F);
831 return FV > 0 && FV <= Version;
832 }
833 return ExtensionsOk;
834}
835
837 switch (Format) {
838 case DWARF32:
839 return "DWARF32";
840 case DWARF64:
841 return "DWARF64";
842 }
843 return StringRef();
844}
845
847 return FormatString(IsDWARF64 ? DWARF64 : DWARF32);
848}
849
851 switch (RLE) {
852 default:
853 return StringRef();
854#define HANDLE_DW_RLE(ID, NAME) \
855 case DW_RLE_##NAME: \
856 return "DW_RLE_" #NAME;
857#include "llvm/BinaryFormat/Dwarf.def"
858 }
859}
860
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:491
StringRef RangeListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:559
StringRef CaseString(unsigned Case)
Definition: Dwarf.cpp:424
StringRef VisibilityString(unsigned Visibility)
Definition: Dwarf.cpp:330
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
Definition: Dwarf.cpp:674
StringRef AttributeString(unsigned Attribute)
Definition: Dwarf.cpp:72
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
Definition: Dwarf.cpp:581
StringRef FormEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:105
StringRef ArrayOrderString(unsigned Order)
Definition: Dwarf.cpp:470
StringRef MacroString(unsigned Encoding)
Definition: Dwarf.cpp:531
StringRef LocListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:570
StringRef IndexString(unsigned Idx)
Definition: Dwarf.cpp:728
StringRef RLEString(unsigned RLE)
Definition: Dwarf.cpp:850
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:610
StringRef AtomTypeString(unsigned Atom)
Definition: Dwarf.cpp:632
StringRef FormatString(DwarfFormat Format)
Definition: Dwarf.cpp:836
StringRef GnuMacroString(unsigned Encoding)
Definition: Dwarf.cpp:542
StringRef EndianityString(unsigned Endian)
Definition: Dwarf.cpp:288
StringRef ConventionString(unsigned Convention)
Definition: Dwarf.cpp:438
StringRef MacinfoString(unsigned Encoding)
Definition: Dwarf.cpp:502
StringRef OperationEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:138
StringRef UnitTypeString(unsigned)
Definition: Dwarf.cpp:621
StringRef InlineCodeString(unsigned Code)
Definition: Dwarf.cpp:456
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
Definition: Dwarf.cpp:651
StringRef TagString(unsigned Tag)
Definition: Dwarf.cpp:21
StringRef LNStandardString(unsigned Standard)
Definition: Dwarf.cpp:480
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:449
unsigned getLanguage(StringRef LanguageString)
Definition: Dwarf.cpp:372
unsigned getVirtuality(StringRef VirtualityString)
Definition: Dwarf.cpp:353
unsigned getMacro(StringRef MacroString)
Definition: Dwarf.cpp:553
unsigned getMacinfo(StringRef MacinfoString)
Definition: Dwarf.cpp:521
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:745
@ DW_INL_declared_not_inlined
Definition: Dwarf.h:747
@ DW_INL_inlined
Definition: Dwarf.h:746
@ DW_INL_declared_inlined
Definition: Dwarf.h:748
@ 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:717
SourceLanguageName
Definition: Dwarf.h:212
@ 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:753
@ DW_ORD_col_major
Definition: Dwarf.h:754
@ 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:731
@ DW_ID_case_insensitive
Definition: Dwarf.h:732
@ DW_ID_case_sensitive
Definition: Dwarf.h:729
@ DW_ID_up_case
Definition: Dwarf.h:730
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:827
@ DW_MACINFO_undef
Definition: Dwarf.h:787
@ DW_MACINFO_start_file
Definition: Dwarf.h:788
@ DW_MACINFO_end_file
Definition: Dwarf.h:789
@ DW_MACINFO_define
Definition: Dwarf.h:786
@ DW_MACINFO_vendor_ext
Definition: Dwarf.h:790
std::optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
Definition: Dwarf.cpp:739
GDBIndexEntryKind
Definition: Dwarf.h:940
@ GIEK_NONE
Definition: Dwarf.h:941
@ GIEK_UNUSED7
Definition: Dwarf.h:948
@ GIEK_TYPE
Definition: Dwarf.h:942
@ GIEK_UNUSED6
Definition: Dwarf.h:947
@ GIEK_OTHER
Definition: Dwarf.h:945
@ GIEK_FUNCTION
Definition: Dwarf.h:944
@ GIEK_UNUSED5
Definition: Dwarf.h:946
@ GIEK_VARIABLE
Definition: Dwarf.h:943
@ DW_CHILDREN_no
Definition: Dwarf.h:834
@ DW_CHILDREN_yes
Definition: Dwarf.h:835
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
Definition: Dwarf.cpp:684
@ 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
llvm::StringRef LanguageDescription(SourceLanguageName name)
Definition: Dwarf.cpp:414
@ DW_ATOM_type_flags
Definition: Dwarf.h:913
@ DW_ATOM_null
Definition: Dwarf.h:908
@ DW_ATOM_die_tag
Definition: Dwarf.h:912
@ DW_ATOM_qual_name_hash
Definition: Dwarf.h:916
@ DW_ATOM_die_offset
Marker as the end of a list of atoms.
Definition: Dwarf.h:909
@ DW_ATOM_type_type_flags
Definition: Dwarf.h:915
@ DW_ATOM_cu_offset
Definition: Dwarf.h:910
@ 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:951
@ GIEL_EXTERNAL
Definition: Dwarf.h:951
@ GIEL_STATIC
Definition: Dwarf.h:951
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:1066
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
Definition: Dwarf.h:1084
uint8_t getRefAddrByteSize() const
The definition of the size of form DW_FORM_ref_addr depends on the version.
Definition: Dwarf.h:1077