20 using namespace dwarf;
26 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR) \ 28 return "DW_TAG_" #NAME; 29 #include "llvm/BinaryFormat/Dwarf.def" 36 .Case(
"DW_TAG_" #NAME, DW_TAG_##NAME)
37 #include "llvm/BinaryFormat/Dwarf.def" 45 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR) \ 48 #include "llvm/BinaryFormat/Dwarf.def" 56 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR) \ 58 return DWARF_VENDOR_##VENDOR; 59 #include "llvm/BinaryFormat/Dwarf.def" 66 return "DW_CHILDREN_no";
68 return "DW_CHILDREN_yes";
77 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \ 79 return "DW_AT_" #NAME; 80 #include "llvm/BinaryFormat/Dwarf.def" 88 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \ 91 #include "llvm/BinaryFormat/Dwarf.def" 99 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) \ 101 return DWARF_VENDOR_##VENDOR; 102 #include "llvm/BinaryFormat/Dwarf.def" 110 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) \ 111 case DW_FORM_##NAME: \ 112 return "DW_FORM_" #NAME; 113 #include "llvm/BinaryFormat/Dwarf.def" 121 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) \ 122 case DW_FORM_##NAME: \ 124 #include "llvm/BinaryFormat/Dwarf.def" 132 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) \ 133 case DW_FORM_##NAME: \ 134 return DWARF_VENDOR_##VENDOR; 135 #include "llvm/BinaryFormat/Dwarf.def" 143 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \ 145 return "DW_OP_" #NAME; 146 #include "llvm/BinaryFormat/Dwarf.def" 148 return "DW_OP_LLVM_fragment";
155 .Case(
"DW_OP_" #NAME, DW_OP_##NAME)
156 #include "llvm/BinaryFormat/Dwarf.def" 165 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \ 168 #include "llvm/BinaryFormat/Dwarf.def" 176 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) \ 178 return DWARF_VENDOR_##VENDOR; 179 #include "llvm/BinaryFormat/Dwarf.def" 187 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \ 188 case DW_ATE_##NAME: \ 189 return "DW_ATE_" #NAME; 190 #include "llvm/BinaryFormat/Dwarf.def" 197 .Case(
"DW_ATE_" #NAME, DW_ATE_##NAME)
198 #include "llvm/BinaryFormat/Dwarf.def" 206 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \ 207 case DW_ATE_##NAME: \ 209 #include "llvm/BinaryFormat/Dwarf.def" 217 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) \ 218 case DW_ATE_##NAME: \ 219 return DWARF_VENDOR_##VENDOR; 220 #include "llvm/BinaryFormat/Dwarf.def" 227 return "DW_DS_unsigned";
229 return "DW_DS_leading_overpunch";
231 return "DW_DS_trailing_overpunch";
233 return "DW_DS_leading_separate";
235 return "DW_DS_trailing_separate";
243 return "DW_END_default";
247 return "DW_END_little";
249 return "DW_END_lo_user";
251 return "DW_END_hi_user";
260 return "DW_ACCESS_public";
262 return "DW_ACCESS_protected";
264 return "DW_ACCESS_private";
270 switch (Visibility) {
272 return "DW_VIS_local";
274 return "DW_VIS_exported";
276 return "DW_VIS_qualified";
282 switch (Virtuality) {
285 #define HANDLE_DW_VIRTUALITY(ID, NAME) \ 286 case DW_VIRTUALITY_##NAME: \ 287 return "DW_VIRTUALITY_" #NAME; 288 #include "llvm/BinaryFormat/Dwarf.def" 295 .Case(
"DW_VIRTUALITY_" #NAME, DW_VIRTUALITY_##NAME)
296 #include "llvm/BinaryFormat/Dwarf.def" 304 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ 305 case DW_LANG_##NAME: \ 306 return "DW_LANG_" #NAME; 307 #include "llvm/BinaryFormat/Dwarf.def" 314 .Case(
"DW_LANG_" #NAME, DW_LANG_##NAME)
315 #include "llvm/BinaryFormat/Dwarf.def" 323 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ 324 case DW_LANG_##NAME: \ 326 #include "llvm/BinaryFormat/Dwarf.def" 334 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ 335 case DW_LANG_##NAME: \ 336 return DWARF_VENDOR_##VENDOR; 337 #include "llvm/BinaryFormat/Dwarf.def" 345 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ 346 case DW_LANG_##NAME: \ 348 #include "llvm/BinaryFormat/Dwarf.def" 355 return "DW_ID_case_sensitive";
357 return "DW_ID_up_case";
359 return "DW_ID_down_case";
361 return "DW_ID_case_insensitive";
370 #define HANDLE_DW_CC(ID, NAME) \ 372 return "DW_CC_" #NAME; 373 #include "llvm/BinaryFormat/Dwarf.def" 379 #define
HANDLE_DW_CC(
ID, NAME) .Case(
"DW_CC_" #NAME, DW_CC_##NAME)
380 #include "llvm/BinaryFormat/Dwarf.def" 387 return "DW_INL_not_inlined";
389 return "DW_INL_inlined";
391 return "DW_INL_declared_not_inlined";
393 return "DW_INL_declared_inlined";
401 return "DW_ORD_row_major";
403 return "DW_ORD_col_major";
412 #define HANDLE_DW_LNS(ID, NAME) \ 413 case DW_LNS_##NAME: \ 414 return "DW_LNS_" #NAME; 415 #include "llvm/BinaryFormat/Dwarf.def" 423 #define HANDLE_DW_LNE(ID, NAME) \ 424 case DW_LNE_##NAME: \ 425 return "DW_LNE_" #NAME; 426 #include "llvm/BinaryFormat/Dwarf.def" 434 return "DW_MACINFO_define";
436 return "DW_MACINFO_undef";
438 return "DW_MACINFO_start_file";
440 return "DW_MACINFO_end_file";
442 return "DW_MACINFO_vendor_ext";
444 return "DW_MACINFO_invalid";
463 #define HANDLE_DW_RLE(ID, NAME) \ 464 case DW_RLE_##NAME: \ 465 return "DW_RLE_" #NAME; 466 #include "llvm/BinaryFormat/Dwarf.def" 472 assert(Arch != llvm::Triple::ArchType::UnknownArch);
473 #define SELECT_AARCH64 (Arch == llvm::Triple::aarch64_be || Arch == llvm::Triple::aarch64) 474 #define SELECT_MIPS64 Arch == llvm::Triple::mips64 475 #define SELECT_SPARC (Arch == llvm::Triple::sparc || Arch == llvm::Triple::sparcv9) 476 #define SELECT_X86 (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) 477 #define HANDLE_DW_CFA(ID, NAME) 478 #define HANDLE_DW_CFA_PRED(ID, NAME, PRED) \ 479 if (ID == Encoding && PRED) \ 480 return "DW_CFA_" #NAME; 481 #include "llvm/BinaryFormat/Dwarf.def" 486 #define HANDLE_DW_CFA_PRED(ID, NAME, PRED) 487 #define HANDLE_DW_CFA(ID, NAME) \ 488 case DW_CFA_##NAME: \ 489 return "DW_CFA_" #NAME; 490 #include "llvm/BinaryFormat/Dwarf.def" 495 #undef SELECT_AARCH64 503 #define HANDLE_DW_APPLE_PROPERTY(ID, NAME) \ 504 case DW_APPLE_PROPERTY_##NAME: \ 505 return "DW_APPLE_PROPERTY_" #NAME; 506 #include "llvm/BinaryFormat/Dwarf.def" 514 #define HANDLE_DW_UT(ID, NAME) \ 516 return "DW_UT_" #NAME; 517 #include "llvm/BinaryFormat/Dwarf.def" 524 return "DW_ATOM_null";
526 return "DW_ATOM_die_offset";
528 return "DW_ATOM_cu_offset";
530 return "DW_ATOM_die_tag";
533 return "DW_ATOM_type_flags";
535 return "DW_ATOM_qual_name_hash";
575 case DW_AT_accessibility:
577 case DW_AT_virtuality:
583 case DW_AT_decimal_sign:
585 case DW_AT_endianity:
587 case DW_AT_visibility:
589 case DW_AT_identifier_case:
591 case DW_AT_calling_convention:
597 case DW_AT_APPLE_runtime_class:
619 #define HANDLE_DW_IDX(ID, NAME) \ 620 case DW_IDX_##NAME: \ 621 return "DW_IDX_" #NAME; 622 #include "llvm/BinaryFormat/Dwarf.def" 641 case DW_FORM_ref_udata:
642 case DW_FORM_indirect:
643 case DW_FORM_exprloc:
646 case DW_FORM_loclistx:
647 case DW_FORM_rnglistx:
648 case DW_FORM_GNU_addr_index:
649 case DW_FORM_GNU_str_index:
652 case DW_FORM_ref_addr:
675 case DW_FORM_ref_sup4:
681 case DW_FORM_GNU_ref_alt:
682 case DW_FORM_GNU_strp_alt:
683 case DW_FORM_line_strp:
684 case DW_FORM_sec_offset:
685 case DW_FORM_strp_sup:
692 case DW_FORM_ref_sig8:
693 case DW_FORM_ref_sup8:
696 case DW_FORM_flag_present:
702 case DW_FORM_implicit_const:
717 return FV > 0 && FV <=
Version;
#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR)
unsigned FormVersion(Form F)
StringRef ApplePropertyString(unsigned)
StringRef IndexString(unsigned Idx)
This class represents lattice values for constants.
StringRef AtomTypeString(unsigned Atom)
unsigned FormVendor(Form F)
#define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR)
StringRef LNExtendedString(unsigned Encoding)
StringRef LNStandardString(unsigned Standard)
unsigned TagVendor(Tag T)
ELFYAML::ELF_STV Visibility
Optional< unsigned > LanguageLowerBound(SourceLanguage L)
unsigned getVirtuality(StringRef VirtualityString)
constexpr char Language[]
Key for Kernel::Metadata::mLanguage.
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR)
unsigned TagVersion(Tag T)
StringRef FormEncodingString(unsigned Encoding)
unsigned AttributeVendor(Attribute A)
Only used in LLVM metadata.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
unsigned LanguageVendor(SourceLanguage L)
StringRef AttributeString(unsigned Attribute)
StringRef LanguageString(unsigned Language)
StringRef DecimalSignString(unsigned Sign)
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
unsigned LanguageVersion(SourceLanguage L)
A switch()-like statement whose cases are string literals.
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
#define HANDLE_DW_VIRTUALITY(ID, NAME)
StringRef AccessibilityString(unsigned Access)
StringRef EndianityString(unsigned Endian)
StringRef AttributeEncodingString(unsigned Encoding)
unsigned OperationVendor(LocationAtom O)
unsigned getCallingConvention(StringRef LanguageString)
unsigned getOperationEncoding(StringRef OperationEncodingString)
StringRef ArrayOrderString(unsigned Order)
unsigned OperationVersion(LocationAtom O)
#define HANDLE_DW_CC(ID, NAME)
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
unsigned getLanguage(StringRef LanguageString)
StringRef RangeListEncodingString(unsigned Encoding)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef VirtualityString(unsigned Virtuality)
StringRef OperationEncodingString(unsigned Encoding)
unsigned getTag(StringRef TagString)
StringRef CaseString(unsigned Case)
unsigned AttributeVersion(Attribute A)
unsigned AttributeEncodingVersion(TypeKind E)
StringRef VisibilityString(unsigned Visibility)
This file contains constants used for implementing Dwarf debug support.
StringRef UnitTypeString(unsigned)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
Optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
StringRef TagString(unsigned Tag)
unsigned AttributeEncodingVendor(TypeKind E)
#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR)
StringRef InlineCodeString(unsigned Code)
StringRef ConventionString(unsigned Convention)
unsigned getMacinfo(StringRef MacinfoString)
StringRef ChildrenString(unsigned Children)
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...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
unsigned getAttributeEncoding(StringRef EncodingString)
StringRef - Represent a constant reference to a string, i.e.
StringRef MacinfoString(unsigned Encoding)
Marker as the end of a list of atoms.