25#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
27 return "DW_TAG_" #NAME;
28#include "llvm/BinaryFormat/Dwarf.def"
34#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
35 .Case("DW_TAG_" #NAME, DW_TAG_##NAME)
36#include "llvm/BinaryFormat/Dwarf.def"
44#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
47#include "llvm/BinaryFormat/Dwarf.def"
55#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
57 return DWARF_VENDOR_##VENDOR;
58#include "llvm/BinaryFormat/Dwarf.def"
65 return "DW_CHILDREN_no";
67 return "DW_CHILDREN_yes";
76#define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
78 return "DW_AT_" #NAME;
79#include "llvm/BinaryFormat/Dwarf.def"
87#define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
90#include "llvm/BinaryFormat/Dwarf.def"
98#define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \
100 return DWARF_VENDOR_##VENDOR;
101#include "llvm/BinaryFormat/Dwarf.def"
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"
120#define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) \
121 case DW_FORM_##NAME: \
123#include "llvm/BinaryFormat/Dwarf.def"
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"
142#define HANDLE_DW_OP(ID, NAME, OPERANDS, ARITY, VERSION, VENDOR) \
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";
157 return "DW_OP_LLVM_arg";
159 return "DW_OP_LLVM_extract_bits_sext";
161 return "DW_OP_LLVM_extract_bits_zext";
167#define HANDLE_DW_OP(ID, NAME, OPERANDS, ARITY, VERSION, VENDOR) \
168 .Case("DW_OP_" #NAME, DW_OP_##NAME)
169#include "llvm/BinaryFormat/Dwarf.def"
185#define HANDLE_DW_OP_LLVM_USEROP(ID, NAME) \
186 case DW_OP_LLVM_##NAME: \
187 return "DW_OP_LLVM_" #NAME;
188#include "llvm/BinaryFormat/Dwarf.def"
195#define HANDLE_DW_OP_LLVM_USEROP(ID, NAME) .Case(#NAME, DW_OP_LLVM_##NAME)
196#include "llvm/BinaryFormat/Dwarf.def"
198 assert(
E &&
"unhandled DWARF operation string with LLVM user op");
203 unsigned SubOpEncoding) {
204 assert(OpEncoding == DW_OP_LLVM_user);
211 assert(OpEncoding == DW_OP_LLVM_user);
219#define HANDLE_DW_OP(ID, NAME, OPERANDS, ARITY, VERSION, VENDOR) \
222#include "llvm/BinaryFormat/Dwarf.def"
230#define HANDLE_DW_OP(ID, NAME, OPERANDS, ARITY, VERSION, VENDOR) \
232 if (OPERANDS == -1) \
233 return std::nullopt; \
235#include "llvm/BinaryFormat/Dwarf.def"
243#define HANDLE_DW_OP(ID, NAME, OPERANDS, ARITY, VERSION, VENDOR) \
246 return std::nullopt; \
248#include "llvm/BinaryFormat/Dwarf.def"
256#define HANDLE_DW_OP(ID, NAME, OPERANDS, ARITY, VERSION, VENDOR) \
258 return DWARF_VENDOR_##VENDOR;
259#include "llvm/BinaryFormat/Dwarf.def"
267#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
268 case DW_ATE_##NAME: \
269 return "DW_ATE_" #NAME;
270#include "llvm/BinaryFormat/Dwarf.def"
276#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
277 .Case("DW_ATE_" #NAME, DW_ATE_##NAME)
278#include "llvm/BinaryFormat/Dwarf.def"
286#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
287 case DW_ATE_##NAME: \
289#include "llvm/BinaryFormat/Dwarf.def"
297#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
298 case DW_ATE_##NAME: \
299 return DWARF_VENDOR_##VENDOR;
300#include "llvm/BinaryFormat/Dwarf.def"
307 return "DW_DS_unsigned";
309 return "DW_DS_leading_overpunch";
311 return "DW_DS_trailing_overpunch";
313 return "DW_DS_leading_separate";
315 return "DW_DS_trailing_separate";
323 return "DW_END_default";
327 return "DW_END_little";
329 return "DW_END_lo_user";
331 return "DW_END_hi_user";
340 return "DW_ACCESS_public";
342 return "DW_ACCESS_protected";
344 return "DW_ACCESS_private";
350 switch (DefaultedEncodings) {
352 case DW_DEFAULTED_no:
353 return "DW_DEFAULTED_no";
354 case DW_DEFAULTED_in_class:
355 return "DW_DEFAULTED_in_class";
356 case DW_DEFAULTED_out_of_class:
357 return "DW_DEFAULTED_out_of_class";
363 switch (Visibility) {
365 return "DW_VIS_local";
367 return "DW_VIS_exported";
369 return "DW_VIS_qualified";
375 switch (Virtuality) {
378#define HANDLE_DW_VIRTUALITY(ID, NAME) \
379 case DW_VIRTUALITY_##NAME: \
380 return "DW_VIRTUALITY_" #NAME;
381#include "llvm/BinaryFormat/Dwarf.def"
387#define HANDLE_DW_VIRTUALITY(ID, NAME) \
388 .Case("DW_VIRTUALITY_" #NAME, DW_VIRTUALITY_##NAME)
389#include "llvm/BinaryFormat/Dwarf.def"
397#define HANDLE_DW_APPLE_ENUM_KIND(ID, NAME) \
398 case DW_APPLE_ENUM_KIND_##NAME: \
399 return "DW_APPLE_ENUM_KIND_" #NAME;
400#include "llvm/BinaryFormat/Dwarf.def"
406#define HANDLE_DW_APPLE_ENUM_KIND(ID, NAME) \
407 .Case("DW_APPLE_ENUM_KIND_" #NAME, DW_APPLE_ENUM_KIND_##NAME)
408#include "llvm/BinaryFormat/Dwarf.def"
416#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
417 case DW_LANG_##NAME: \
418 return "DW_LANG_" #NAME;
419#include "llvm/BinaryFormat/Dwarf.def"
425#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
426 .Case("DW_LANG_" #NAME, DW_LANG_##NAME)
427#include "llvm/BinaryFormat/Dwarf.def"
435#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
436 case DW_LANG_##NAME: \
438#include "llvm/BinaryFormat/Dwarf.def"
446#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
447 case DW_LANG_##NAME: \
448 return DWARF_VENDOR_##VENDOR;
449#include "llvm/BinaryFormat/Dwarf.def"
453std::optional<unsigned>
458#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
459 case DW_LANG_##NAME: \
461#include "llvm/BinaryFormat/Dwarf.def"
467#define HANDLE_DW_LNAME(ID, NAME, DESC, LOWER_BOUND) \
468 case DW_LNAME_##NAME: \
470#include "llvm/BinaryFormat/Dwarf.def"
478 return "DW_ID_case_sensitive";
480 return "DW_ID_up_case";
482 return "DW_ID_down_case";
484 return "DW_ID_case_insensitive";
493#define HANDLE_DW_CC(ID, NAME) \
495 return "DW_CC_" #NAME;
496#include "llvm/BinaryFormat/Dwarf.def"
502#define HANDLE_DW_CC(ID, NAME) .Case("DW_CC_" #NAME, DW_CC_##NAME)
503#include "llvm/BinaryFormat/Dwarf.def"
510 return "DW_INL_not_inlined";
512 return "DW_INL_inlined";
514 return "DW_INL_declared_not_inlined";
516 return "DW_INL_declared_inlined";
524 return "DW_ORD_row_major";
526 return "DW_ORD_col_major";
535#define HANDLE_DW_LNS(ID, NAME) \
536 case DW_LNS_##NAME: \
537 return "DW_LNS_" #NAME;
538#include "llvm/BinaryFormat/Dwarf.def"
546#define HANDLE_DW_LNE(ID, NAME) \
547 case DW_LNE_##NAME: \
548 return "DW_LNE_" #NAME;
549#include "llvm/BinaryFormat/Dwarf.def"
557 return "DW_MACINFO_define";
559 return "DW_MACINFO_undef";
561 return "DW_MACINFO_start_file";
563 return "DW_MACINFO_end_file";
565 return "DW_MACINFO_vendor_ext";
567 return "DW_MACINFO_invalid";
586#define HANDLE_DW_MACRO(ID, NAME) \
587 case DW_MACRO_##NAME: \
588 return "DW_MACRO_" #NAME;
589#include "llvm/BinaryFormat/Dwarf.def"
597#define HANDLE_DW_MACRO_GNU(ID, NAME) \
598 case DW_MACRO_GNU_##NAME: \
599 return "DW_MACRO_GNU_" #NAME;
600#include "llvm/BinaryFormat/Dwarf.def"
606#define HANDLE_DW_MACRO(ID, NAME) .Case("DW_MACRO_" #NAME, ID)
607#include "llvm/BinaryFormat/Dwarf.def"
614#define HANDLE_DW_RLE(ID, NAME) \
615 case DW_RLE_##NAME: \
616 return "DW_RLE_" #NAME;
617#include "llvm/BinaryFormat/Dwarf.def"
625#define HANDLE_DW_LLE(ID, NAME) \
626 case DW_LLE_##NAME: \
627 return "DW_LLE_" #NAME;
628#include "llvm/BinaryFormat/Dwarf.def"
635#define SELECT_AARCH64 (Arch == llvm::Triple::aarch64_be || Arch == llvm::Triple::aarch64)
636#define SELECT_MIPS64 Arch == llvm::Triple::mips64
637#define SELECT_SPARC (Arch == llvm::Triple::sparc || Arch == llvm::Triple::sparcv9)
638#define SELECT_X86 (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64)
639#define HANDLE_DW_CFA(ID, NAME)
640#define HANDLE_DW_CFA_PRED(ID, NAME, PRED) \
641 if (ID == Encoding && PRED) \
642 return "DW_CFA_" #NAME;
643#include "llvm/BinaryFormat/Dwarf.def"
648#define HANDLE_DW_CFA_PRED(ID, NAME, PRED)
649#define HANDLE_DW_CFA(ID, NAME) \
650 case DW_CFA_##NAME: \
651 return "DW_CFA_" #NAME;
652#include "llvm/BinaryFormat/Dwarf.def"
665#define HANDLE_DW_APPLE_PROPERTY(ID, NAME) \
666 case DW_APPLE_PROPERTY_##NAME: \
667 return "DW_APPLE_PROPERTY_" #NAME;
668#include "llvm/BinaryFormat/Dwarf.def"
676#define HANDLE_DW_UT(ID, NAME) \
678 return "DW_UT_" #NAME;
679#include "llvm/BinaryFormat/Dwarf.def"
686 return "DW_ATOM_null";
688 return "DW_ATOM_die_offset";
690 return "DW_ATOM_cu_offset";
692 return "DW_ATOM_die_tag";
695 return "DW_ATOM_type_flags";
697 return "DW_ATOM_qual_name_hash";
737 case DW_AT_accessibility:
739 case DW_AT_virtuality:
745 case DW_AT_decimal_sign:
747 case DW_AT_endianity:
749 case DW_AT_visibility:
751 case DW_AT_identifier_case:
753 case DW_AT_calling_convention:
759 case DW_AT_APPLE_runtime_class:
761 case DW_AT_defaulted:
763 case DW_AT_APPLE_enum_kind:
785#define HANDLE_DW_IDX(ID, NAME) \
786 case DW_IDX_##NAME: \
787 return "DW_IDX_" #NAME;
788#include "llvm/BinaryFormat/Dwarf.def"
807 case DW_FORM_ref_udata:
808 case DW_FORM_indirect:
809 case DW_FORM_exprloc:
812 case DW_FORM_loclistx:
813 case DW_FORM_rnglistx:
814 case DW_FORM_GNU_addr_index:
815 case DW_FORM_GNU_str_index:
818 case DW_FORM_ref_addr:
842 case DW_FORM_ref_sup4:
848 case DW_FORM_GNU_ref_alt:
849 case DW_FORM_GNU_strp_alt:
850 case DW_FORM_line_strp:
851 case DW_FORM_sec_offset:
852 case DW_FORM_strp_sup:
859 case DW_FORM_ref_sig8:
860 case DW_FORM_ref_sup8:
863 case DW_FORM_flag_present:
869 case DW_FORM_implicit_const:
884 return FV > 0 && FV <=
Version;
907#define HANDLE_DW_RLE(ID, NAME) \
908 case DW_RLE_##NAME: \
909 return "DW_RLE_" #NAME;
910#include "llvm/BinaryFormat/Dwarf.def"
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static unsigned getLlvmUserOperationEncoding(StringRef LlvmUserOperationEncodingString)
static StringRef LlvmUserOperationEncodingString(unsigned Encoding)
This file contains constants used for implementing Dwarf debug support.
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.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
LLVM_ABI StringRef LNExtendedString(unsigned Encoding)
LLVM_ABI StringRef RangeListEncodingString(unsigned Encoding)
LLVM_ABI StringRef CaseString(unsigned Case)
LLVM_ABI StringRef VisibilityString(unsigned Visibility)
LLVM_ABI StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
LLVM_ABI StringRef AttributeString(unsigned Attribute)
LLVM_ABI StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
LLVM_ABI StringRef FormEncodingString(unsigned Encoding)
LLVM_ABI StringRef ArrayOrderString(unsigned Order)
LLVM_ABI StringRef MacroString(unsigned Encoding)
LLVM_ABI StringRef EnumKindString(unsigned EnumKind)
LLVM_ABI StringRef LocListEncodingString(unsigned Encoding)
LLVM_ABI StringRef IndexString(unsigned Idx)
LLVM_ABI StringRef RLEString(unsigned RLE)
LLVM_ABI StringRef SubOperationEncodingString(unsigned OpEncoding, unsigned SubOpEncoding)
LLVM_ABI StringRef LanguageString(unsigned Language)
LLVM_ABI StringRef DecimalSignString(unsigned Sign)
LLVM_ABI StringRef VirtualityString(unsigned Virtuality)
LLVM_ABI StringRef AttributeEncodingString(unsigned Encoding)
LLVM_ABI StringRef ChildrenString(unsigned Children)
LLVM_ABI StringRef ApplePropertyString(unsigned)
LLVM_ABI StringRef AtomTypeString(unsigned Atom)
LLVM_ABI StringRef FormatString(DwarfFormat Format)
LLVM_ABI StringRef GnuMacroString(unsigned Encoding)
LLVM_ABI StringRef EndianityString(unsigned Endian)
LLVM_ABI StringRef ConventionString(unsigned Convention)
LLVM_ABI StringRef MacinfoString(unsigned Encoding)
LLVM_ABI StringRef OperationEncodingString(unsigned Encoding)
LLVM_ABI StringRef UnitTypeString(unsigned)
LLVM_ABI StringRef InlineCodeString(unsigned Code)
LLVM_ABI StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
LLVM_ABI StringRef TagString(unsigned Tag)
LLVM_ABI StringRef LNStandardString(unsigned Standard)
LLVM_ABI StringRef AccessibilityString(unsigned Access)
LLVM_ABI StringRef DefaultedMemberString(unsigned DefaultedEncodings)
LLVM_ABI unsigned getSubOperationEncoding(unsigned OpEncoding, StringRef SubOperationEncodingString)
LLVM_ABI unsigned getOperationEncoding(StringRef OperationEncodingString)
LLVM_ABI unsigned getAttributeEncoding(StringRef EncodingString)
LLVM_ABI unsigned getTag(StringRef TagString)
LLVM_ABI unsigned getCallingConvention(StringRef LanguageString)
LLVM_ABI unsigned getLanguage(StringRef LanguageString)
LLVM_ABI unsigned getVirtuality(StringRef VirtualityString)
LLVM_ABI unsigned getEnumKind(StringRef EnumKindString)
LLVM_ABI unsigned getMacro(StringRef MacroString)
LLVM_ABI unsigned getMacinfo(StringRef MacinfoString)
LLVM_ABI unsigned AttributeEncodingVendor(TypeKind E)
LLVM_ABI unsigned FormVendor(Form F)
LLVM_ABI unsigned AttributeVendor(Attribute A)
LLVM_ABI unsigned OperationVendor(LocationAtom O)
LLVM_ABI unsigned TagVendor(Tag T)
LLVM_ABI unsigned LanguageVendor(SourceLanguage L)
LLVM_ABI unsigned OperationVersion(LocationAtom O)
LLVM_ABI unsigned AttributeVersion(Attribute A)
LLVM_ABI unsigned LanguageVersion(SourceLanguage L)
LLVM_ABI unsigned AttributeEncodingVersion(TypeKind E)
LLVM_ABI unsigned TagVersion(Tag T)
LLVM_ABI unsigned FormVersion(Form F)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Calculates the starting offsets for various sections within the .debug_names section.
@ DW_INL_declared_not_inlined
@ DW_INL_declared_inlined
LLVM_ABI std::optional< unsigned > LanguageLowerBound(SourceLanguage L)
LLVM_ABI StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
LLVM_ABI std::optional< unsigned > OperationArity(LocationAtom O)
The arity of the given LocationAtom.
@ DW_OP_LLVM_entry_value
Only used in LLVM metadata.
@ DW_OP_LLVM_implicit_pointer
Only used in LLVM metadata.
@ DW_OP_LLVM_extract_bits_zext
Only used in LLVM metadata.
@ DW_OP_LLVM_tag_offset
Only used in LLVM metadata.
@ DW_OP_LLVM_fragment
Only used in LLVM metadata.
@ DW_OP_LLVM_arg
Only used in LLVM metadata.
@ DW_OP_LLVM_convert
Only used in LLVM metadata.
@ DW_OP_LLVM_extract_bits_sext
Only used in LLVM metadata.
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
LLVM_ABI 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...
LLVM_ABI std::optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
LLVM_ABI StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
LLVM_ABI std::optional< unsigned > OperationOperands(LocationAtom O)
The number of operands for the given LocationAtom.
@ DW_DS_trailing_separate
@ DW_DS_trailing_overpunch
@ DW_DS_leading_overpunch
LLVM_ABI llvm::StringRef LanguageDescription(SourceLanguageName name)
@ DW_ATOM_die_offset
Marker as the end of a list of atoms.
@ DW_ATOM_type_type_flags
@ DW_TAG_invalid
LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def).
@ DW_MACINFO_invalid
Macinfo type for invalid results.
@ DW_APPLE_ENUM_KIND_invalid
Enum kind for invalid results.
@ DW_VIRTUALITY_invalid
Virtuality for invalid results.
@ DWARF_VENDOR_DWARF
Identifiers we use to distinguish vendor extensions.
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr uintptr_t uintptr_t Version
DWARFExpression::Operation Op