19 #ifndef LLVM_BINARYFORMAT_DWARF_H 20 #define LLVM_BINARYFORMAT_DWARF_H 84 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) DW_TAG_##NAME = ID, 85 #include "llvm/BinaryFormat/Dwarf.def" 95 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \ 97 return (KIND == DW_KIND_TYPE); 98 #include "llvm/BinaryFormat/Dwarf.def" 104 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) DW_AT_##NAME = ID, 105 #include "llvm/BinaryFormat/Dwarf.def" 111 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) DW_FORM_##NAME = ID, 112 #include "llvm/BinaryFormat/Dwarf.def" 117 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) DW_OP_##NAME = ID, 118 #include "llvm/BinaryFormat/Dwarf.def" 128 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID, 129 #include "llvm/BinaryFormat/Dwarf.def" 145 #define HANDLE_DW_END(ID, NAME) DW_END_##NAME = ID, 146 #include "llvm/BinaryFormat/Dwarf.def" 166 #define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID, 167 #include "llvm/BinaryFormat/Dwarf.def" 172 #define HANDLE_DW_DEFAULTED(ID, NAME) DW_DEFAULTED_##NAME = ID, 173 #include "llvm/BinaryFormat/Dwarf.def" 178 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ 180 #include "llvm/BinaryFormat/Dwarf.def" 190 case DW_LANG_C_plus_plus:
191 case DW_LANG_C_plus_plus_03:
192 case DW_LANG_C_plus_plus_11:
193 case DW_LANG_C_plus_plus_14:
198 case DW_LANG_Cobol74:
199 case DW_LANG_Cobol85:
200 case DW_LANG_Fortran77:
201 case DW_LANG_Fortran90:
202 case DW_LANG_Pascal83:
203 case DW_LANG_Modula2:
207 case DW_LANG_Fortran95:
210 case DW_LANG_ObjC_plus_plus:
216 case DW_LANG_Modula3:
217 case DW_LANG_Haskell:
224 case DW_LANG_Fortran03:
225 case DW_LANG_Fortran08:
226 case DW_LANG_RenderScript:
228 case DW_LANG_Mips_Assembler:
229 case DW_LANG_GOOGLE_RenderScript:
230 case DW_LANG_BORLAND_Delphi:
248 #define HANDLE_DW_CC(ID, NAME) DW_CC_##NAME = ID, 249 #include "llvm/BinaryFormat/Dwarf.def" 276 #define HANDLE_DW_LNS(ID, NAME) DW_LNS_##NAME = ID, 277 #include "llvm/BinaryFormat/Dwarf.def" 282 #define HANDLE_DW_LNE(ID, NAME) DW_LNE_##NAME = ID, 283 #include "llvm/BinaryFormat/Dwarf.def" 289 #define HANDLE_DW_LNCT(ID, NAME) DW_LNCT_##NAME = ID, 290 #include "llvm/BinaryFormat/Dwarf.def" 306 #define HANDLE_DW_MACRO(ID, NAME) DW_MACRO_##NAME = ID, 307 #include "llvm/BinaryFormat/Dwarf.def" 314 #define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID, 315 #include "llvm/BinaryFormat/Dwarf.def" 320 #define HANDLE_DW_LLE(ID, NAME) DW_LLE_##NAME = ID, 321 #include "llvm/BinaryFormat/Dwarf.def" 326 #define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID, 327 #define HANDLE_DW_CFA_PRED(ID, NAME, ARCH) DW_CFA_##NAME = ID, 328 #include "llvm/BinaryFormat/Dwarf.def" 362 #define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID, 363 #include "llvm/BinaryFormat/Dwarf.def" 368 #define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID, 369 #include "llvm/BinaryFormat/Dwarf.def" 375 #define HANDLE_DW_IDX(ID, NAME) DW_IDX_##NAME = ID, 376 #include "llvm/BinaryFormat/Dwarf.def" 387 case DW_UT_split_compile:
388 case DW_UT_split_type:
397 case DW_TAG_compile_unit:
398 case DW_TAG_type_unit:
399 case DW_TAG_partial_unit:
400 case DW_TAG_skeleton_unit:
615 : Kind(Kind), Linkage(Linkage) {}
624 return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET;
630 KIND_MASK = 7 << KIND_OFFSET,
632 LINKAGE_MASK = 1 << LINKAGE_OFFSET
636 template <
typename Enum>
struct EnumTraits :
public std::false_type {};
638 template <>
struct EnumTraits<Attribute> :
public std::true_type {
639 static constexpr
char Type[3] =
"AT";
643 template <>
struct EnumTraits<Form> :
public std::true_type {
644 static constexpr
char Type[5] =
"FORM";
649 static constexpr
char Type[4] =
"IDX";
654 static constexpr
char Type[4] =
"TAG";
664 template <
typename Enum>
666 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)
LoclistEntries
DWARF v5 loc list entry encoding values.
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.
Only used in LLVM metadata.
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)
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
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)
StringRef LanguageString(unsigned Language)
StringRef DecimalSignString(unsigned Sign)
uint8_t getUnitLengthFieldByteSize(DwarfFormat Format)
Get the byte size of the unit length field depending on the DWARF format.
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)
Only used in LLVM metadata.
unsigned getOperationEncoding(StringRef OperationEncodingString)
StringRef ArrayOrderString(unsigned Order)
Recommended base for user tags.
unsigned OperationVersion(LocationAtom O)
RnglistEntries
DWARF v5 range list entry encoding values.
Only used in LLVM metadata.
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)
PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
unsigned AttributeEncodingVersion(TypeKind E)
StringRef VisibilityString(unsigned Visibility)
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)
Linkage
Describes symbol linkage.
StringRef DefaultedMemberString(unsigned DefaultedEncodings)
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...
StringRef LocListEncodingString(unsigned Encoding)
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.
bool isCPlusPlus(SourceLanguage S)
const uint64_t DW64_CIE_ID