1 //===-- llvm/BinaryFormat/Dwarf.cpp - Dwarf Framework ------------*- C++-*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file contains support for generic dwarf information.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/BinaryFormat/Dwarf.h"
14 #include "llvm/ADT/StringSwitch.h"
15 #include "llvm/Support/ErrorHandling.h"
16 #include "llvm/TargetParser/Triple.h"
19 using namespace dwarf
;
21 StringRef
llvm::dwarf::TagString(unsigned Tag
) {
25 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
27 return "DW_TAG_" #NAME;
28 #include "llvm/BinaryFormat/Dwarf.def"
32 unsigned llvm::dwarf::getTag(StringRef TagString
) {
33 return StringSwitch
<unsigned>(TagString
)
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
);
40 unsigned llvm::dwarf::TagVersion(dwarf::Tag Tag
) {
44 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
47 #include "llvm/BinaryFormat/Dwarf.def"
51 unsigned llvm::dwarf::TagVendor(dwarf::Tag Tag
) {
55 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
57 return DWARF_VENDOR_##VENDOR;
58 #include "llvm/BinaryFormat/Dwarf.def"
62 StringRef
llvm::dwarf::ChildrenString(unsigned Children
) {
65 return "DW_CHILDREN_no";
67 return "DW_CHILDREN_yes";
72 StringRef
llvm::dwarf::AttributeString(unsigned Attribute
) {
76 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
78 return "DW_AT_" #NAME;
79 #include "llvm/BinaryFormat/Dwarf.def"
83 unsigned llvm::dwarf::AttributeVersion(dwarf::Attribute Attribute
) {
87 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
90 #include "llvm/BinaryFormat/Dwarf.def"
94 unsigned llvm::dwarf::AttributeVendor(dwarf::Attribute Attribute
) {
98 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
100 return DWARF_VENDOR_##VENDOR;
101 #include "llvm/BinaryFormat/Dwarf.def"
105 StringRef
llvm::dwarf::FormEncodingString(unsigned Encoding
) {
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"
116 unsigned llvm::dwarf::FormVersion(dwarf::Form Form
) {
120 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) \
121 case DW_FORM_##NAME: \
123 #include "llvm/BinaryFormat/Dwarf.def"
127 unsigned llvm::dwarf::FormVendor(dwarf::Form Form
) {
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"
138 StringRef
llvm::dwarf::OperationEncodingString(unsigned Encoding
) {
142 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
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";
150 case DW_OP_LLVM_tag_offset
:
151 return "DW_OP_LLVM_tag_offset";
152 case DW_OP_LLVM_entry_value
:
153 return "DW_OP_LLVM_entry_value";
154 case DW_OP_LLVM_implicit_pointer
:
155 return "DW_OP_LLVM_implicit_pointer";
157 return "DW_OP_LLVM_arg";
161 unsigned llvm::dwarf::getOperationEncoding(StringRef OperationEncodingString
) {
162 return StringSwitch
<unsigned>(OperationEncodingString
)
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
)
175 static StringRef
LlvmUserOperationEncodingString(unsigned Encoding
) {
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"
187 getLlvmUserOperationEncoding(StringRef LlvmUserOperationEncodingString
) {
188 unsigned E
= StringSwitch
<unsigned>(LlvmUserOperationEncodingString
)
189 #define HANDLE_DW_OP_LLVM_USEROP(ID, NAME) .Case(#NAME, DW_OP_LLVM_##NAME)
190 #include "llvm/BinaryFormat/Dwarf.def"
192 assert(E
&& "unhandled DWARF operation string with LLVM user op");
196 StringRef
llvm::dwarf::SubOperationEncodingString(unsigned OpEncoding
,
197 unsigned SubOpEncoding
) {
198 assert(OpEncoding
== DW_OP_LLVM_user
);
199 return LlvmUserOperationEncodingString(SubOpEncoding
);
203 llvm::dwarf::getSubOperationEncoding(unsigned OpEncoding
,
204 StringRef SubOperationEncodingString
) {
205 assert(OpEncoding
== DW_OP_LLVM_user
);
206 return getLlvmUserOperationEncoding(SubOperationEncodingString
);
209 unsigned llvm::dwarf::OperationVersion(dwarf::LocationAtom Op
) {
213 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
216 #include "llvm/BinaryFormat/Dwarf.def"
220 unsigned llvm::dwarf::OperationVendor(dwarf::LocationAtom Op
) {
224 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
226 return DWARF_VENDOR_##VENDOR;
227 #include "llvm/BinaryFormat/Dwarf.def"
231 StringRef
llvm::dwarf::AttributeEncodingString(unsigned Encoding
) {
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"
242 unsigned llvm::dwarf::getAttributeEncoding(StringRef EncodingString
) {
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"
250 unsigned llvm::dwarf::AttributeEncodingVersion(dwarf::TypeKind ATE
) {
254 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
255 case DW_ATE_##NAME: \
257 #include "llvm/BinaryFormat/Dwarf.def"
261 unsigned llvm::dwarf::AttributeEncodingVendor(dwarf::TypeKind ATE
) {
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"
272 StringRef
llvm::dwarf::DecimalSignString(unsigned Sign
) {
275 return "DW_DS_unsigned";
276 case DW_DS_leading_overpunch
:
277 return "DW_DS_leading_overpunch";
278 case DW_DS_trailing_overpunch
:
279 return "DW_DS_trailing_overpunch";
280 case DW_DS_leading_separate
:
281 return "DW_DS_leading_separate";
282 case DW_DS_trailing_separate
:
283 return "DW_DS_trailing_separate";
288 StringRef
llvm::dwarf::EndianityString(unsigned Endian
) {
291 return "DW_END_default";
295 return "DW_END_little";
297 return "DW_END_lo_user";
299 return "DW_END_hi_user";
304 StringRef
llvm::dwarf::AccessibilityString(unsigned Access
) {
306 // Accessibility codes
307 case DW_ACCESS_public
:
308 return "DW_ACCESS_public";
309 case DW_ACCESS_protected
:
310 return "DW_ACCESS_protected";
311 case DW_ACCESS_private
:
312 return "DW_ACCESS_private";
317 StringRef
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";
330 StringRef
llvm::dwarf::VisibilityString(unsigned Visibility
) {
331 switch (Visibility
) {
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";
342 StringRef
llvm::dwarf::VirtualityString(unsigned Virtuality
) {
343 switch (Virtuality
) {
346 #define HANDLE_DW_VIRTUALITY(ID, NAME) \
347 case DW_VIRTUALITY_##NAME: \
348 return "DW_VIRTUALITY_" #NAME;
349 #include "llvm/BinaryFormat/Dwarf.def"
353 unsigned llvm::dwarf::getVirtuality(StringRef VirtualityString
) {
354 return StringSwitch
<unsigned>(VirtualityString
)
355 #define HANDLE_DW_VIRTUALITY(ID, NAME) \
356 .Case("DW_VIRTUALITY_" #NAME, DW_VIRTUALITY_##NAME)
357 #include "llvm/BinaryFormat/Dwarf.def"
358 .Default(DW_VIRTUALITY_invalid
);
361 StringRef
llvm::dwarf::LanguageString(unsigned Language
) {
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"
372 unsigned llvm::dwarf::getLanguage(StringRef LanguageString
) {
373 return StringSwitch
<unsigned>(LanguageString
)
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"
380 unsigned llvm::dwarf::LanguageVersion(dwarf::SourceLanguage Lang
) {
384 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
385 case DW_LANG_##NAME: \
387 #include "llvm/BinaryFormat/Dwarf.def"
391 unsigned llvm::dwarf::LanguageVendor(dwarf::SourceLanguage Lang
) {
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"
402 std::optional
<unsigned>
403 llvm::dwarf::LanguageLowerBound(dwarf::SourceLanguage Lang
) {
407 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
408 case DW_LANG_##NAME: \
410 #include "llvm/BinaryFormat/Dwarf.def"
414 StringRef
llvm::dwarf::CaseString(unsigned Case
) {
416 case DW_ID_case_sensitive
:
417 return "DW_ID_case_sensitive";
419 return "DW_ID_up_case";
420 case DW_ID_down_case
:
421 return "DW_ID_down_case";
422 case DW_ID_case_insensitive
:
423 return "DW_ID_case_insensitive";
428 StringRef
llvm::dwarf::ConventionString(unsigned CC
) {
432 #define HANDLE_DW_CC(ID, NAME) \
434 return "DW_CC_" #NAME;
435 #include "llvm/BinaryFormat/Dwarf.def"
439 unsigned llvm::dwarf::getCallingConvention(StringRef CCString
) {
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"
446 StringRef
llvm::dwarf::InlineCodeString(unsigned Code
) {
448 case DW_INL_not_inlined
:
449 return "DW_INL_not_inlined";
451 return "DW_INL_inlined";
452 case DW_INL_declared_not_inlined
:
453 return "DW_INL_declared_not_inlined";
454 case DW_INL_declared_inlined
:
455 return "DW_INL_declared_inlined";
460 StringRef
llvm::dwarf::ArrayOrderString(unsigned 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";
470 StringRef
llvm::dwarf::LNStandardString(unsigned Standard
) {
474 #define HANDLE_DW_LNS(ID, NAME) \
475 case DW_LNS_##NAME: \
476 return "DW_LNS_" #NAME;
477 #include "llvm/BinaryFormat/Dwarf.def"
481 StringRef
llvm::dwarf::LNExtendedString(unsigned Encoding
) {
485 #define HANDLE_DW_LNE(ID, NAME) \
486 case DW_LNE_##NAME: \
487 return "DW_LNE_" #NAME;
488 #include "llvm/BinaryFormat/Dwarf.def"
492 StringRef
llvm::dwarf::MacinfoString(unsigned Encoding
) {
494 // Macinfo Type Encodings
495 case DW_MACINFO_define
:
496 return "DW_MACINFO_define";
497 case DW_MACINFO_undef
:
498 return "DW_MACINFO_undef";
499 case DW_MACINFO_start_file
:
500 return "DW_MACINFO_start_file";
501 case DW_MACINFO_end_file
:
502 return "DW_MACINFO_end_file";
503 case DW_MACINFO_vendor_ext
:
504 return "DW_MACINFO_vendor_ext";
505 case DW_MACINFO_invalid
:
506 return "DW_MACINFO_invalid";
511 unsigned llvm::dwarf::getMacinfo(StringRef MacinfoString
) {
512 return StringSwitch
<unsigned>(MacinfoString
)
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
)
518 .Default(DW_MACINFO_invalid
);
521 StringRef
llvm::dwarf::MacroString(unsigned Encoding
) {
525 #define HANDLE_DW_MACRO(ID, NAME) \
526 case DW_MACRO_##NAME: \
527 return "DW_MACRO_" #NAME;
528 #include "llvm/BinaryFormat/Dwarf.def"
532 StringRef
llvm::dwarf::GnuMacroString(unsigned Encoding
) {
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"
543 unsigned llvm::dwarf::getMacro(StringRef MacroString
) {
544 return StringSwitch
<unsigned>(MacroString
)
545 #define HANDLE_DW_MACRO(ID, NAME) .Case("DW_MACRO_" #NAME, ID)
546 #include "llvm/BinaryFormat/Dwarf.def"
547 .Default(DW_MACINFO_invalid
);
549 StringRef
llvm::dwarf::RangeListEncodingString(unsigned Encoding
) {
553 #define HANDLE_DW_RLE(ID, NAME) \
554 case DW_RLE_##NAME: \
555 return "DW_RLE_" #NAME;
556 #include "llvm/BinaryFormat/Dwarf.def"
560 StringRef
llvm::dwarf::LocListEncodingString(unsigned Encoding
) {
564 #define HANDLE_DW_LLE(ID, NAME) \
565 case DW_LLE_##NAME: \
566 return "DW_LLE_" #NAME;
567 #include "llvm/BinaryFormat/Dwarf.def"
571 StringRef
llvm::dwarf::CallFrameString(unsigned Encoding
,
572 Triple::ArchType Arch
) {
573 assert(Arch
!= llvm::Triple::ArchType::UnknownArch
);
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"
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"
596 #undef SELECT_AARCH64
600 StringRef
llvm::dwarf::ApplePropertyString(unsigned Prop
) {
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"
611 StringRef
llvm::dwarf::UnitTypeString(unsigned UT
) {
615 #define HANDLE_DW_UT(ID, NAME) \
617 return "DW_UT_" #NAME;
618 #include "llvm/BinaryFormat/Dwarf.def"
622 StringRef
llvm::dwarf::AtomTypeString(unsigned AT
) {
624 case dwarf::DW_ATOM_null
:
625 return "DW_ATOM_null";
626 case dwarf::DW_ATOM_die_offset
:
627 return "DW_ATOM_die_offset";
628 case DW_ATOM_cu_offset
:
629 return "DW_ATOM_cu_offset";
630 case DW_ATOM_die_tag
:
631 return "DW_ATOM_die_tag";
632 case DW_ATOM_type_flags
:
633 case DW_ATOM_type_type_flags
:
634 return "DW_ATOM_type_flags";
635 case DW_ATOM_qual_name_hash
:
636 return "DW_ATOM_qual_name_hash";
641 StringRef
llvm::dwarf::GDBIndexEntryKindString(GDBIndexEntryKind Kind
) {
660 llvm_unreachable("Unknown GDBIndexEntryKind value");
664 llvm::dwarf::GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage
) {
671 llvm_unreachable("Unknown GDBIndexEntryLinkage value");
674 StringRef
llvm::dwarf::AttributeValueString(uint16_t Attr
, unsigned Val
) {
676 case DW_AT_accessibility
:
677 return AccessibilityString(Val
);
678 case DW_AT_virtuality
:
679 return VirtualityString(Val
);
681 return LanguageString(Val
);
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
);
695 return InlineCodeString(Val
);
697 return ArrayOrderString(Val
);
698 case DW_AT_APPLE_runtime_class
:
699 return LanguageString(Val
);
700 case DW_AT_defaulted
:
701 return DefaultedMemberString(Val
);
707 StringRef
llvm::dwarf::AtomValueString(uint16_t Atom
, unsigned Val
) {
711 case DW_ATOM_die_tag
:
712 return TagString(Val
);
718 StringRef
llvm::dwarf::IndexString(unsigned Idx
) {
722 #define HANDLE_DW_IDX(ID, NAME) \
723 case DW_IDX_##NAME: \
724 return "DW_IDX_" #NAME;
725 #include "llvm/BinaryFormat/Dwarf.def"
729 std::optional
<uint8_t> llvm::dwarf::getFixedFormByteSize(dwarf::Form Form
,
734 return Params
.AddrSize
;
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.
755 case DW_FORM_ref_addr
:
757 return Params
.getRefAddrByteSize();
779 case DW_FORM_ref_sup4
:
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
:
791 return Params
.getDwarfOffsetByteSize();
796 case DW_FORM_ref_sig8
:
797 case DW_FORM_ref_sup8
:
800 case DW_FORM_flag_present
:
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.
817 bool llvm::dwarf::isValidFormForVersion(Form F
, unsigned Version
,
819 if (FormVendor(F
) == DWARF_VENDOR_DWARF
) {
820 unsigned FV
= FormVersion(F
);
821 return FV
> 0 && FV
<= Version
;
826 StringRef
llvm::dwarf::FormatString(DwarfFormat Format
) {
836 StringRef
llvm::dwarf::FormatString(bool IsDWARF64
) {
837 return FormatString(IsDWARF64
? DWARF64
: DWARF32
);
840 StringRef
llvm::dwarf::RLEString(unsigned RLE
) {
844 #define HANDLE_DW_RLE(ID, NAME) \
845 case DW_RLE_##NAME: \
846 return "DW_RLE_" #NAME;
847 #include "llvm/BinaryFormat/Dwarf.def"
851 constexpr char llvm::dwarf::EnumTraits
<Attribute
>::Type
[];
852 constexpr char llvm::dwarf::EnumTraits
<Form
>::Type
[];
853 constexpr char llvm::dwarf::EnumTraits
<Index
>::Type
[];
854 constexpr char llvm::dwarf::EnumTraits
<Tag
>::Type
[];
855 constexpr char llvm::dwarf::EnumTraits
<LineNumberOps
>::Type
[];
856 constexpr char llvm::dwarf::EnumTraits
<LocationAtom
>::Type
[];