20 #ifndef LLVM_BINARYFORMAT_DWARF_H 21 #define LLVM_BINARYFORMAT_DWARF_H 79 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR) DW_TAG_##NAME = ID, 80 #include "llvm/BinaryFormat/Dwarf.def" 88 case DW_TAG_array_type:
89 case DW_TAG_class_type:
90 case DW_TAG_interface_type:
91 case DW_TAG_enumeration_type:
92 case DW_TAG_pointer_type:
93 case DW_TAG_reference_type:
94 case DW_TAG_rvalue_reference_type:
95 case DW_TAG_string_type:
96 case DW_TAG_structure_type:
97 case DW_TAG_subroutine_type:
98 case DW_TAG_union_type:
99 case DW_TAG_ptr_to_member_type:
100 case DW_TAG_set_type:
101 case DW_TAG_subrange_type:
102 case DW_TAG_base_type:
103 case DW_TAG_const_type:
104 case DW_TAG_file_type:
105 case DW_TAG_packed_type:
106 case DW_TAG_volatile_type:
116 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) DW_AT_##NAME = ID, 117 #include "llvm/BinaryFormat/Dwarf.def" 123 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) DW_FORM_##NAME = ID, 124 #include "llvm/BinaryFormat/Dwarf.def" 129 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) DW_OP_##NAME = ID, 130 #include "llvm/BinaryFormat/Dwarf.def" 137 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID, 138 #include "llvm/BinaryFormat/Dwarf.def" 154 #define HANDLE_DW_END(ID, NAME) DW_END_##NAME = ID, 155 #include "llvm/BinaryFormat/Dwarf.def" 175 #define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID, 176 #include "llvm/BinaryFormat/Dwarf.def" 181 #define HANDLE_DW_DEFAULTED(ID, NAME) DW_DEFAULTED_##NAME = ID, 182 #include "llvm/BinaryFormat/Dwarf.def" 187 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ 189 #include "llvm/BinaryFormat/Dwarf.def" 204 #define HANDLE_DW_CC(ID, NAME) DW_CC_##NAME = ID, 205 #include "llvm/BinaryFormat/Dwarf.def" 232 #define HANDLE_DW_LNS(ID, NAME) DW_LNS_##NAME = ID, 233 #include "llvm/BinaryFormat/Dwarf.def" 238 #define HANDLE_DW_LNE(ID, NAME) DW_LNE_##NAME = ID, 239 #include "llvm/BinaryFormat/Dwarf.def" 245 #define HANDLE_DW_LNCT(ID, NAME) DW_LNCT_##NAME = ID, 246 #include "llvm/BinaryFormat/Dwarf.def" 262 #define HANDLE_DW_MACRO(ID, NAME) DW_MACRO_##NAME = ID, 263 #include "llvm/BinaryFormat/Dwarf.def" 270 #define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID, 271 #include "llvm/BinaryFormat/Dwarf.def" 276 #define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID, 277 #define HANDLE_DW_CFA_PRED(ID, NAME, ARCH) DW_CFA_##NAME = ID, 278 #include "llvm/BinaryFormat/Dwarf.def" 325 #define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID, 326 #include "llvm/BinaryFormat/Dwarf.def" 331 #define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID, 332 #include "llvm/BinaryFormat/Dwarf.def" 338 #define HANDLE_DW_IDX(ID, NAME) DW_IDX_##NAME = ID, 339 #include "llvm/BinaryFormat/Dwarf.def" 350 case DW_UT_split_compile:
351 case DW_UT_split_type:
360 case DW_TAG_compile_unit:
361 case DW_TAG_type_unit:
362 case DW_TAG_partial_unit:
363 case DW_TAG_skeleton_unit:
565 : Kind(Kind), Linkage(Linkage) {}
574 return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET;
580 KIND_MASK = 7 << KIND_OFFSET,
582 LINKAGE_MASK = 1 << LINKAGE_OFFSET
586 template <
typename Enum>
struct EnumTraits :
public std::false_type {};
588 template <>
struct EnumTraits<Attribute> :
public std::true_type {
589 static constexpr
char Type[3] =
"AT";
593 template <>
struct EnumTraits<Form> :
public std::true_type {
594 static constexpr
char Type[5] =
"FORM";
599 static constexpr
char Type[4] =
"IDX";
604 static constexpr
char Type[4] =
"TAG";
614 template <
typename Enum>
616 Enum, typename
std::enable_if<dwarf::EnumTraits<Enum>::value>
::type> {
unsigned FormVersion(Form F)
StringRef ApplePropertyString(unsigned)
PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
StringRef IndexString(unsigned Idx)
LineNumberOps
Line Number Standard Opcode Encodings.
This class represents lattice values for constants.
StringRef AtomTypeString(unsigned Atom)
unsigned FormVendor(Form F)
bool isUnitType(uint8_t UnitType)
StringRef LNExtendedString(unsigned Encoding)
StringRef LNStandardString(unsigned Standard)
unsigned TagVendor(Tag T)
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
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)
CallFrameInfo
Call frame instruction encodings.
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
unsigned TagVersion(Tag T)
unsigned AttributeVendor(Attribute A)
StringRef FormEncodingString(unsigned Encoding)
Only used in LLVM metadata.
PubIndexEntryDescriptor(uint8_t Value)
unsigned LanguageVendor(SourceLanguage L)
Describes an entry of the various gnu_pub* debug sections.
MacroEntryType
DWARF v5 macro information entry type encodings.
StringRef AttributeString(unsigned Attribute)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
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)
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
StringRef AccessibilityString(unsigned Access)
const uint32_t DW_INVALID_OFFSET
Identifier of an invalid DIE offset in the .debug_info section.
StringRef EndianityString(unsigned Endian)
StringRef AttributeEncodingString(unsigned Encoding)
The instances of the Type class are immutable: once they are created, they are never changed...
unsigned OperationVendor(LocationAtom O)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
unsigned getCallingConvention(StringRef LanguageString)
unsigned getOperationEncoding(StringRef OperationEncodingString)
StringRef ArrayOrderString(unsigned Order)
Recommended base for user tags.
unsigned OperationVersion(LocationAtom O)
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
GDBIndexEntryLinkage Linkage
unsigned getLanguage(StringRef LanguageString)
StringRef RangeListEncodingString(unsigned Encoding)
LineNumberExtendedOps
Line Number Extended Opcode Encodings.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef VirtualityString(unsigned Virtuality)
StringRef OperationEncodingString(unsigned Encoding)
const uint32_t DW_CIE_ID
Special ID values that distinguish a CIE from a FDE in DWARF CFI.
unsigned getTag(StringRef TagString)
UnitType
Constants for unit types in DWARF v5.
StringRef CaseString(unsigned Case)
ApplePropertyAttributes
Constants for the DW_APPLE_PROPERTY_attributes attribute.
unsigned AttributeVersion(Attribute A)
LocationListEntry
Constants for location lists in DWARF v5.
PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
unsigned AttributeEncodingVersion(TypeKind E)
StringRef VisibilityString(unsigned Visibility)
RangeListEntries
DWARF v5 range list entry encoding values.
StringRef UnitTypeString(unsigned)
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)
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...
LLVM Value Representation.
unsigned getAttributeEncoding(StringRef EncodingString)
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
StringRef MacinfoString(unsigned Encoding)
Marker as the end of a list of atoms.
const uint64_t DW64_CIE_ID