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, 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";
163#define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
164 .Case("DW_OP_" #NAME, DW_OP_##NAME)
165#include "llvm/BinaryFormat/Dwarf.def"
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"
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");
197 unsigned SubOpEncoding) {
198 assert(OpEncoding == DW_OP_LLVM_user);
205 assert(OpEncoding == DW_OP_LLVM_user);
213#define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
216#include "llvm/BinaryFormat/Dwarf.def"
224#define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \
226 return DWARF_VENDOR_##VENDOR;
227#include "llvm/BinaryFormat/Dwarf.def"
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"
244#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
245 .Case("DW_ATE_" #NAME, DW_ATE_##NAME)
246#include "llvm/BinaryFormat/Dwarf.def"
254#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \
255 case DW_ATE_##NAME: \
257#include "llvm/BinaryFormat/Dwarf.def"
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"
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";
291 return "DW_END_default";
295 return "DW_END_little";
297 return "DW_END_lo_user";
299 return "DW_END_hi_user";
308 return "DW_ACCESS_public";
310 return "DW_ACCESS_protected";
312 return "DW_ACCESS_private";
318 switch (DefaultedEncodings) {
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";
331 switch (Visibility) {
333 return "DW_VIS_local";
335 return "DW_VIS_exported";
337 return "DW_VIS_qualified";
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"
355#define HANDLE_DW_VIRTUALITY(ID, NAME) \
356 .Case("DW_VIRTUALITY_" #NAME, DW_VIRTUALITY_##NAME)
357#include "llvm/BinaryFormat/Dwarf.def"
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"
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"
384#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
385 case DW_LANG_##NAME: \
387#include "llvm/BinaryFormat/Dwarf.def"
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"
402std::optional<unsigned>
407#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
408 case DW_LANG_##NAME: \
410#include "llvm/BinaryFormat/Dwarf.def"
416#define HANDLE_DW_LNAME(ID, NAME, DESC, LOWER_BOUND) \
417 case DW_LNAME_##NAME: \
419#include "llvm/BinaryFormat/Dwarf.def"
427 return "DW_ID_case_sensitive";
429 return "DW_ID_up_case";
431 return "DW_ID_down_case";
433 return "DW_ID_case_insensitive";
442#define HANDLE_DW_CC(ID, NAME) \
444 return "DW_CC_" #NAME;
445#include "llvm/BinaryFormat/Dwarf.def"
451#define HANDLE_DW_CC(ID, NAME) .Case("DW_CC_" #NAME, DW_CC_##NAME)
452#include "llvm/BinaryFormat/Dwarf.def"
459 return "DW_INL_not_inlined";
461 return "DW_INL_inlined";
463 return "DW_INL_declared_not_inlined";
465 return "DW_INL_declared_inlined";
473 return "DW_ORD_row_major";
475 return "DW_ORD_col_major";
484#define HANDLE_DW_LNS(ID, NAME) \
485 case DW_LNS_##NAME: \
486 return "DW_LNS_" #NAME;
487#include "llvm/BinaryFormat/Dwarf.def"
495#define HANDLE_DW_LNE(ID, NAME) \
496 case DW_LNE_##NAME: \
497 return "DW_LNE_" #NAME;
498#include "llvm/BinaryFormat/Dwarf.def"
506 return "DW_MACINFO_define";
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";
535#define HANDLE_DW_MACRO(ID, NAME) \
536 case DW_MACRO_##NAME: \
537 return "DW_MACRO_" #NAME;
538#include "llvm/BinaryFormat/Dwarf.def"
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"
555#define HANDLE_DW_MACRO(ID, NAME) .Case("DW_MACRO_" #NAME, ID)
556#include "llvm/BinaryFormat/Dwarf.def"
563#define HANDLE_DW_RLE(ID, NAME) \
564 case DW_RLE_##NAME: \
565 return "DW_RLE_" #NAME;
566#include "llvm/BinaryFormat/Dwarf.def"
574#define HANDLE_DW_LLE(ID, NAME) \
575 case DW_LLE_##NAME: \
576 return "DW_LLE_" #NAME;
577#include "llvm/BinaryFormat/Dwarf.def"
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"
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"
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"
625#define HANDLE_DW_UT(ID, NAME) \
627 return "DW_UT_" #NAME;
628#include "llvm/BinaryFormat/Dwarf.def"
635 return "DW_ATOM_null";
637 return "DW_ATOM_die_offset";
639 return "DW_ATOM_cu_offset";
641 return "DW_ATOM_die_tag";
644 return "DW_ATOM_type_flags";
646 return "DW_ATOM_qual_name_hash";
686 case DW_AT_accessibility:
688 case DW_AT_virtuality:
694 case DW_AT_decimal_sign:
696 case DW_AT_endianity:
698 case DW_AT_visibility:
700 case DW_AT_identifier_case:
702 case DW_AT_calling_convention:
708 case DW_AT_APPLE_runtime_class:
710 case DW_AT_defaulted:
732#define HANDLE_DW_IDX(ID, NAME) \
733 case DW_IDX_##NAME: \
734 return "DW_IDX_" #NAME;
735#include "llvm/BinaryFormat/Dwarf.def"
754 case DW_FORM_ref_udata:
755 case DW_FORM_indirect:
756 case DW_FORM_exprloc:
759 case DW_FORM_loclistx:
760 case DW_FORM_rnglistx:
761 case DW_FORM_GNU_addr_index:
762 case DW_FORM_GNU_str_index:
765 case DW_FORM_ref_addr:
789 case DW_FORM_ref_sup4:
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:
806 case DW_FORM_ref_sig8:
807 case DW_FORM_ref_sup8:
810 case DW_FORM_flag_present:
816 case DW_FORM_implicit_const:
831 return FV > 0 && FV <= Version;
854#define HANDLE_DW_RLE(ID, NAME) \
855 case DW_RLE_##NAME: \
856 return "DW_RLE_" #NAME;
857#include "llvm/BinaryFormat/Dwarf.def"
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)
static StringRef LlvmUserOperationEncodingString(unsigned Encoding)
This file contains constants used for implementing Dwarf debug support.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringRef LNExtendedString(unsigned Encoding)
StringRef RangeListEncodingString(unsigned Encoding)
StringRef CaseString(unsigned Case)
StringRef VisibilityString(unsigned Visibility)
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
StringRef AttributeString(unsigned Attribute)
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
StringRef FormEncodingString(unsigned Encoding)
StringRef ArrayOrderString(unsigned Order)
StringRef MacroString(unsigned Encoding)
StringRef LocListEncodingString(unsigned Encoding)
StringRef IndexString(unsigned Idx)
StringRef RLEString(unsigned RLE)
StringRef SubOperationEncodingString(unsigned OpEncoding, unsigned SubOpEncoding)
StringRef LanguageString(unsigned Language)
StringRef DecimalSignString(unsigned Sign)
StringRef VirtualityString(unsigned Virtuality)
StringRef AttributeEncodingString(unsigned Encoding)
StringRef ChildrenString(unsigned Children)
StringRef ApplePropertyString(unsigned)
StringRef AtomTypeString(unsigned Atom)
StringRef FormatString(DwarfFormat Format)
StringRef GnuMacroString(unsigned Encoding)
StringRef EndianityString(unsigned Endian)
StringRef ConventionString(unsigned Convention)
StringRef MacinfoString(unsigned Encoding)
StringRef OperationEncodingString(unsigned Encoding)
StringRef UnitTypeString(unsigned)
StringRef InlineCodeString(unsigned Code)
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
StringRef TagString(unsigned Tag)
StringRef LNStandardString(unsigned Standard)
StringRef AccessibilityString(unsigned Access)
StringRef DefaultedMemberString(unsigned DefaultedEncodings)
unsigned getSubOperationEncoding(unsigned OpEncoding, StringRef SubOperationEncodingString)
unsigned getOperationEncoding(StringRef OperationEncodingString)
unsigned getAttributeEncoding(StringRef EncodingString)
unsigned getTag(StringRef TagString)
unsigned getCallingConvention(StringRef LanguageString)
unsigned getLanguage(StringRef LanguageString)
unsigned getVirtuality(StringRef VirtualityString)
unsigned getMacro(StringRef MacroString)
unsigned getMacinfo(StringRef MacinfoString)
unsigned AttributeEncodingVendor(TypeKind E)
unsigned FormVendor(Form F)
unsigned AttributeVendor(Attribute A)
unsigned OperationVendor(LocationAtom O)
unsigned TagVendor(Tag T)
unsigned LanguageVendor(SourceLanguage L)
unsigned OperationVersion(LocationAtom O)
unsigned AttributeVersion(Attribute A)
unsigned LanguageVersion(SourceLanguage L)
unsigned AttributeEncodingVersion(TypeKind E)
unsigned TagVersion(Tag T)
unsigned FormVersion(Form F)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ DW_INL_declared_not_inlined
@ DW_INL_declared_inlined
std::optional< unsigned > LanguageLowerBound(SourceLanguage L)
StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
@ DW_OP_LLVM_entry_value
Only used in LLVM metadata.
@ DW_OP_LLVM_implicit_pointer
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.
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
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...
std::optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
@ DW_DS_trailing_separate
@ DW_DS_trailing_overpunch
@ DW_DS_leading_overpunch
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_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.