diff options
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h | 4 | ||||
-rw-r--r-- | llvm/include/llvm/Support/Dwarf.def | 19 | ||||
-rw-r--r-- | llvm/include/llvm/Support/Dwarf.h | 13 |
3 files changed, 30 insertions, 6 deletions
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h index db7b59be90c..786eba306c2 100644 --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h @@ -124,6 +124,7 @@ class DWARFUnit { uint32_t Length; uint16_t Version; const DWARFAbbreviationDeclarationSet *Abbrevs; + uint8_t UnitType; uint8_t AddrSize; uint64_t BaseAddr; // The compile unit debug information entry items. @@ -152,7 +153,7 @@ class DWARFUnit { protected: virtual bool extractImpl(DataExtractor debug_info, uint32_t *offset_ptr); /// Size in bytes of the unit header. - virtual uint32_t getHeaderSize() const { return 11; } + virtual uint32_t getHeaderSize() const { return Version <= 4 ? 11 : 12; } public: DWARFUnit(DWARFContext &Context, const DWARFSection &Section, @@ -208,6 +209,7 @@ public: const DWARFAbbreviationDeclarationSet *getAbbreviations() const { return Abbrevs; } + uint8_t getUnitType() const { return UnitType; } uint8_t getAddressByteSize() const { return AddrSize; } uint8_t getRefAddrByteSize() const { if (Version == 2) diff --git a/llvm/include/llvm/Support/Dwarf.def b/llvm/include/llvm/Support/Dwarf.def index 841fc7d4ae2..4ef0176a491 100644 --- a/llvm/include/llvm/Support/Dwarf.def +++ b/llvm/include/llvm/Support/Dwarf.def @@ -19,7 +19,8 @@ defined HANDLE_DW_CC || defined HANDLE_DW_LNS || \ defined HANDLE_DW_LNE || defined HANDLE_DW_LNCT || \ defined HANDLE_DW_MACRO || defined HANDLE_DW_RLE || \ - defined HANDLE_DW_CFA || defined HANDLE_DW_APPLE_PROPERTY) + defined HANDLE_DW_CFA || defined HANDLE_DW_APPLE_PROPERTY || \ + defined HANDLE_DW_UT) #error "Missing macro definition of HANDLE_DW*" #endif @@ -87,6 +88,10 @@ #define HANDLE_DW_APPLE_PROPERTY(ID, NAME) #endif +#ifndef HANDLE_DW_UT +#define HANDLE_DW_UT(ID, NAME) +#endif + HANDLE_DW_TAG(0x0000, null) HANDLE_DW_TAG(0x0001, array_type) HANDLE_DW_TAG(0x0002, class_type) @@ -268,7 +273,7 @@ HANDLE_DW_AT(0x6c, const_expr) HANDLE_DW_AT(0x6d, enum_class) HANDLE_DW_AT(0x6e, linkage_name) -// New in DWARF 5: +// New in DWARF v5: HANDLE_DW_AT(0x6f, string_length_bit_size) HANDLE_DW_AT(0x70, string_length_byte_size) HANDLE_DW_AT(0x71, rank) @@ -622,7 +627,7 @@ HANDLE_DW_LANG(0x0011, ObjC_plus_plus) HANDLE_DW_LANG(0x0012, UPC) HANDLE_DW_LANG(0x0013, D) -// New in DWARF 5: +// New in DWARF v5: HANDLE_DW_LANG(0x0014, Python) HANDLE_DW_LANG(0x0015, OpenCL) HANDLE_DW_LANG(0x0016, Go) @@ -792,6 +797,13 @@ HANDLE_DW_APPLE_PROPERTY(0x1000, nullability) HANDLE_DW_APPLE_PROPERTY(0x2000, null_resettable) HANDLE_DW_APPLE_PROPERTY(0x4000, class) +// DWARF v5 Unit Types. +HANDLE_DW_UT(0x01, compile) +HANDLE_DW_UT(0x02, type) +HANDLE_DW_UT(0x03, partial) +HANDLE_DW_UT(0x04, skeleton) +HANDLE_DW_UT(0x05, split_compile) +HANDLE_DW_UT(0x06, split_type) #undef HANDLE_DW_TAG #undef HANDLE_DW_AT @@ -809,3 +821,4 @@ HANDLE_DW_APPLE_PROPERTY(0x4000, class) #undef HANDLE_DW_RLE #undef HANDLE_DW_CFA #undef HANDLE_DW_APPLE_PROPERTY +#undef HANDLE_DW_UT diff --git a/llvm/include/llvm/Support/Dwarf.h b/llvm/include/llvm/Support/Dwarf.h index 8336b9df9df..84056682924 100644 --- a/llvm/include/llvm/Support/Dwarf.h +++ b/llvm/include/llvm/Support/Dwarf.h @@ -29,7 +29,7 @@ class StringRef; namespace dwarf { //===----------------------------------------------------------------------===// -// Dwarf constants as gleaned from the DWARF Debugging Information Format V.4 +// DWARF constants as gleaned from the DWARF Debugging Information Format V.5 // reference manual http://www.dwarfstd.org/. // @@ -305,7 +305,15 @@ enum ApplePropertyAttributes { #include "llvm/Support/Dwarf.def" }; -// Constants for the DWARF5 Accelerator Table Proposal +/// Constants for unit types in DWARF v5. +enum UnitType : unsigned char { +#define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID, +#include "llvm/Support/Dwarf.def" + DW_UT_lo_user = 0x80, + DW_UT_hi_user = 0xff +}; + +// Constants for the DWARF v5 Accelerator Table Proposal enum AcceleratorTable { // Data layout descriptors. DW_ATOM_null = 0u, // Marker as the end of a list of atoms. @@ -373,6 +381,7 @@ StringRef LNExtendedString(unsigned Encoding); StringRef MacinfoString(unsigned Encoding); StringRef CallFrameString(unsigned Encoding); StringRef ApplePropertyString(unsigned); +StringRef UnitTypeString(unsigned); StringRef AtomTypeString(unsigned Atom); StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind); StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage); |