LCOV - code coverage report
Current view: top level - include/llvm/BinaryFormat - Dwarf.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 11 12 91.7 %
Date: 2018-02-23 15:42:53 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- llvm/BinaryFormat/Dwarf.h ---Dwarf Constants-------------*- C++ -*-===//
       2             : //
       3             : //                     The LLVM Compiler Infrastructure
       4             : //
       5             : // This file is distributed under the University of Illinois Open Source
       6             : // License. See LICENSE.TXT for details.
       7             : //
       8             : //===----------------------------------------------------------------------===//
       9             : //
      10             : /// \file
      11             : /// This file contains constants used for implementing Dwarf
      12             : /// debug support.
      13             : ///
      14             : /// For details on the Dwarf specfication see the latest DWARF Debugging
      15             : /// Information Format standard document on http://www.dwarfstd.org. This
      16             : /// file often includes support for non-released standard features.
      17             : //
      18             : //===----------------------------------------------------------------------===//
      19             : 
      20             : #ifndef LLVM_BINARYFORMAT_DWARF_H
      21             : #define LLVM_BINARYFORMAT_DWARF_H
      22             : 
      23             : #include "llvm/Support/Compiler.h"
      24             : #include "llvm/Support/DataTypes.h"
      25             : 
      26             : namespace llvm {
      27             : class StringRef;
      28             : 
      29             : namespace dwarf {
      30             : 
      31             : //===----------------------------------------------------------------------===//
      32             : // DWARF constants as gleaned from the DWARF Debugging Information Format V.5
      33             : // reference manual http://www.dwarfstd.org/.
      34             : //
      35             : 
      36             : // Do not mix the following two enumerations sets.  DW_TAG_invalid changes the
      37             : // enumeration base type.
      38             : 
      39             : enum LLVMConstants : uint32_t {
      40             :   // LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def).
      41             :   DW_TAG_invalid = ~0U,        // Tag for invalid results.
      42             :   DW_VIRTUALITY_invalid = ~0U, // Virtuality for invalid results.
      43             :   DW_MACINFO_invalid = ~0U,    // Macinfo type for invalid results.
      44             : 
      45             :   // Other constants.
      46             :   DWARF_VERSION = 4,       // Default dwarf version we output.
      47             :   DW_PUBTYPES_VERSION = 2, // Section version number for .debug_pubtypes.
      48             :   DW_PUBNAMES_VERSION = 2, // Section version number for .debug_pubnames.
      49             :   DW_ARANGES_VERSION = 2,  // Section version number for .debug_aranges.
      50             :   // Identifiers we use to distinguish vendor extensions.
      51             :   DWARF_VENDOR_DWARF = 0, // Defined in v2 or later of the DWARF standard.
      52             :   DWARF_VENDOR_APPLE = 1,
      53             :   DWARF_VENDOR_BORLAND = 2,
      54             :   DWARF_VENDOR_GNU = 3,
      55             :   DWARF_VENDOR_GOOGLE = 4,
      56             :   DWARF_VENDOR_LLVM = 5,
      57             :   DWARF_VENDOR_MIPS = 6
      58             : };
      59             : 
      60             : /// Special ID values that distinguish a CIE from a FDE in DWARF CFI.
      61             : /// Not inside an enum because a 64-bit value is needed.
      62             : /// @{
      63             : const uint32_t DW_CIE_ID = UINT32_MAX;
      64             : const uint64_t DW64_CIE_ID = UINT64_MAX;
      65             : /// @}
      66             : 
      67             : /// Identifier of an invalid DIE offset in the .debug_info section.
      68             : const uint32_t DW_INVALID_OFFSET = UINT32_MAX;
      69             : 
      70             : enum Tag : uint16_t {
      71             : #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR) DW_TAG_##NAME = ID,
      72             : #include "llvm/BinaryFormat/Dwarf.def"
      73             :   DW_TAG_lo_user = 0x4080,
      74             :   DW_TAG_hi_user = 0xffff,
      75             :   DW_TAG_user_base = 0x1000 ///< Recommended base for user tags.
      76             : };
      77             : 
      78         202 : inline bool isType(Tag T) {
      79         202 :   switch (T) {
      80             :   case DW_TAG_array_type:
      81             :   case DW_TAG_class_type:
      82             :   case DW_TAG_interface_type:
      83             :   case DW_TAG_enumeration_type:
      84             :   case DW_TAG_pointer_type:
      85             :   case DW_TAG_reference_type:
      86             :   case DW_TAG_rvalue_reference_type:
      87             :   case DW_TAG_string_type:
      88             :   case DW_TAG_structure_type:
      89             :   case DW_TAG_subroutine_type:
      90             :   case DW_TAG_union_type:
      91             :   case DW_TAG_ptr_to_member_type:
      92             :   case DW_TAG_set_type:
      93             :   case DW_TAG_subrange_type:
      94             :   case DW_TAG_base_type:
      95             :   case DW_TAG_const_type:
      96             :   case DW_TAG_file_type:
      97             :   case DW_TAG_packed_type:
      98             :   case DW_TAG_volatile_type:
      99             :   case DW_TAG_typedef:
     100             :     return true;
     101         129 :   default:
     102         129 :     return false;
     103             :   }
     104             : }
     105             : 
     106             : /// Attributes.
     107             : enum Attribute : uint16_t {
     108             : #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) DW_AT_##NAME = ID,
     109             : #include "llvm/BinaryFormat/Dwarf.def"
     110             :   DW_AT_lo_user = 0x2000,
     111             :   DW_AT_hi_user = 0x3fff,
     112             : };
     113             : 
     114             : enum Form : uint16_t {
     115             : #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) DW_FORM_##NAME = ID,
     116             : #include "llvm/BinaryFormat/Dwarf.def"
     117             :   DW_FORM_lo_user = 0x1f00, ///< Not specified by DWARF.
     118             : };
     119             : 
     120             : enum LocationAtom {
     121             : #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) DW_OP_##NAME = ID,
     122             : #include "llvm/BinaryFormat/Dwarf.def"
     123             :   DW_OP_lo_user = 0xe0,
     124             :   DW_OP_hi_user = 0xff,
     125             :   DW_OP_LLVM_fragment = 0x1000 ///< Only used in LLVM metadata.
     126             : };
     127             : 
     128             : enum TypeKind : uint8_t {
     129             : #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID,
     130             : #include "llvm/BinaryFormat/Dwarf.def"
     131             :   DW_ATE_lo_user = 0x80,
     132             :   DW_ATE_hi_user = 0xff
     133             : };
     134             : 
     135             : enum DecimalSignEncoding {
     136             :   // Decimal sign attribute values
     137             :   DW_DS_unsigned = 0x01,
     138             :   DW_DS_leading_overpunch = 0x02,
     139             :   DW_DS_trailing_overpunch = 0x03,
     140             :   DW_DS_leading_separate = 0x04,
     141             :   DW_DS_trailing_separate = 0x05
     142             : };
     143             : 
     144             : enum EndianityEncoding {
     145             :   // Endianity attribute values
     146             :   DW_END_default = 0x00,
     147             :   DW_END_big = 0x01,
     148             :   DW_END_little = 0x02,
     149             :   DW_END_lo_user = 0x40,
     150             :   DW_END_hi_user = 0xff
     151             : };
     152             : 
     153             : enum AccessAttribute {
     154             :   // Accessibility codes
     155             :   DW_ACCESS_public = 0x01,
     156             :   DW_ACCESS_protected = 0x02,
     157             :   DW_ACCESS_private = 0x03
     158             : };
     159             : 
     160             : enum VisibilityAttribute {
     161             :   // Visibility codes
     162             :   DW_VIS_local = 0x01,
     163             :   DW_VIS_exported = 0x02,
     164             :   DW_VIS_qualified = 0x03
     165             : };
     166             : 
     167             : enum VirtualityAttribute {
     168             : #define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID,
     169             : #include "llvm/BinaryFormat/Dwarf.def"
     170             :   DW_VIRTUALITY_max = 0x02
     171             : };
     172             : 
     173             : enum DefaultedMemberAttribute {
     174             : #define HANDLE_DW_DEFAULTED(ID, NAME) DW_DEFAULTED_##NAME = ID,
     175             : #include "llvm/BinaryFormat/Dwarf.def"
     176             :   DW_DEFAULTED_max = 0x02
     177             : };
     178             : 
     179             : enum SourceLanguage {
     180             : #define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR) DW_LANG_##NAME = ID,
     181             : #include "llvm/BinaryFormat/Dwarf.def"
     182             :   DW_LANG_lo_user = 0x8000,
     183             :   DW_LANG_hi_user = 0xffff
     184             : };
     185             : 
     186             : enum CaseSensitivity {
     187             :   // Identifier case codes
     188             :   DW_ID_case_sensitive = 0x00,
     189             :   DW_ID_up_case = 0x01,
     190             :   DW_ID_down_case = 0x02,
     191             :   DW_ID_case_insensitive = 0x03
     192             : };
     193             : 
     194             : enum CallingConvention {
     195             : // Calling convention codes
     196             : #define HANDLE_DW_CC(ID, NAME) DW_CC_##NAME = ID,
     197             : #include "llvm/BinaryFormat/Dwarf.def"
     198             :   DW_CC_lo_user = 0x40,
     199             :   DW_CC_hi_user = 0xff
     200             : };
     201             : 
     202             : enum InlineAttribute {
     203             :   // Inline codes
     204             :   DW_INL_not_inlined = 0x00,
     205             :   DW_INL_inlined = 0x01,
     206             :   DW_INL_declared_not_inlined = 0x02,
     207             :   DW_INL_declared_inlined = 0x03
     208             : };
     209             : 
     210             : enum ArrayDimensionOrdering {
     211             :   // Array ordering
     212             :   DW_ORD_row_major = 0x00,
     213             :   DW_ORD_col_major = 0x01
     214             : };
     215             : 
     216             : enum DiscriminantList {
     217             :   // Discriminant descriptor values
     218             :   DW_DSC_label = 0x00,
     219             :   DW_DSC_range = 0x01
     220             : };
     221             : 
     222             : /// Line Number Standard Opcode Encodings.
     223             : enum LineNumberOps : uint8_t {
     224             : #define HANDLE_DW_LNS(ID, NAME) DW_LNS_##NAME = ID,
     225             : #include "llvm/BinaryFormat/Dwarf.def"
     226             : };
     227             : 
     228             : /// Line Number Extended Opcode Encodings.
     229             : enum LineNumberExtendedOps {
     230             : #define HANDLE_DW_LNE(ID, NAME) DW_LNE_##NAME = ID,
     231             : #include "llvm/BinaryFormat/Dwarf.def"
     232             :   DW_LNE_lo_user = 0x80,
     233             :   DW_LNE_hi_user = 0xff
     234             : };
     235             : 
     236             : enum LineNumberEntryFormat {
     237             : #define HANDLE_DW_LNCT(ID, NAME) DW_LNCT_##NAME = ID,
     238             : #include "llvm/BinaryFormat/Dwarf.def"
     239             :   DW_LNCT_lo_user = 0x2000,
     240             :   DW_LNCT_hi_user = 0x3fff,
     241             : };
     242             : 
     243             : enum MacinfoRecordType {
     244             :   // Macinfo Type Encodings
     245             :   DW_MACINFO_define = 0x01,
     246             :   DW_MACINFO_undef = 0x02,
     247             :   DW_MACINFO_start_file = 0x03,
     248             :   DW_MACINFO_end_file = 0x04,
     249             :   DW_MACINFO_vendor_ext = 0xff
     250             : };
     251             : 
     252             : /// DWARF v5 macro information entry type encodings.
     253             : enum MacroEntryType {
     254             : #define HANDLE_DW_MACRO(ID, NAME) DW_MACRO_##NAME = ID,
     255             : #include "llvm/BinaryFormat/Dwarf.def"
     256             :   DW_MACRO_lo_user = 0xe0,
     257             :   DW_MACRO_hi_user = 0xff
     258             : };
     259             : 
     260             : /// DWARF v5 range list entry encoding values.
     261             : enum RangeListEntries {
     262             : #define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID,
     263             : #include "llvm/BinaryFormat/Dwarf.def"
     264             : };
     265             : 
     266             : /// Call frame instruction encodings.
     267             : enum CallFrameInfo {
     268             : #define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID,
     269             : #include "llvm/BinaryFormat/Dwarf.def"
     270             :   DW_CFA_extended = 0x00,
     271             : 
     272             :   DW_CFA_lo_user = 0x1c,
     273             :   DW_CFA_hi_user = 0x3f
     274             : };
     275             : 
     276             : enum Constants {
     277             :   // Children flag
     278             :   DW_CHILDREN_no = 0x00,
     279             :   DW_CHILDREN_yes = 0x01,
     280             : 
     281             :   DW_EH_PE_absptr = 0x00,
     282             :   DW_EH_PE_omit = 0xff,
     283             :   DW_EH_PE_uleb128 = 0x01,
     284             :   DW_EH_PE_udata2 = 0x02,
     285             :   DW_EH_PE_udata4 = 0x03,
     286             :   DW_EH_PE_udata8 = 0x04,
     287             :   DW_EH_PE_sleb128 = 0x09,
     288             :   DW_EH_PE_sdata2 = 0x0A,
     289             :   DW_EH_PE_sdata4 = 0x0B,
     290             :   DW_EH_PE_sdata8 = 0x0C,
     291             :   DW_EH_PE_signed = 0x08,
     292             :   DW_EH_PE_pcrel = 0x10,
     293             :   DW_EH_PE_textrel = 0x20,
     294             :   DW_EH_PE_datarel = 0x30,
     295             :   DW_EH_PE_funcrel = 0x40,
     296             :   DW_EH_PE_aligned = 0x50,
     297             :   DW_EH_PE_indirect = 0x80
     298             : };
     299             : 
     300             : /// Constants for location lists in DWARF v5.
     301             : enum LocationListEntry : unsigned char {
     302             :   DW_LLE_end_of_list = 0x00,
     303             :   DW_LLE_base_addressx = 0x01,
     304             :   DW_LLE_startx_endx = 0x02,
     305             :   DW_LLE_startx_length = 0x03,
     306             :   DW_LLE_offset_pair = 0x04,
     307             :   DW_LLE_default_location = 0x05,
     308             :   DW_LLE_base_address = 0x06,
     309             :   DW_LLE_start_end = 0x07,
     310             :   DW_LLE_start_length = 0x08
     311             : };
     312             : 
     313             : /// Constants for the DW_APPLE_PROPERTY_attributes attribute.
     314             : /// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind!
     315             : enum ApplePropertyAttributes {
     316             : #define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID,
     317             : #include "llvm/BinaryFormat/Dwarf.def"
     318             : };
     319             : 
     320             : /// Constants for unit types in DWARF v5.
     321             : enum UnitType : unsigned char {
     322             : #define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID,
     323             : #include "llvm/BinaryFormat/Dwarf.def"
     324             :   DW_UT_lo_user = 0x80,
     325             :   DW_UT_hi_user = 0xff
     326             : };
     327             : 
     328             : enum Index {
     329             : #define HANDLE_DW_IDX(ID, NAME) DW_IDX_##NAME = ID,
     330             : #include "llvm/BinaryFormat/Dwarf.def"
     331             :   DW_IDX_lo_user = 0x2000,
     332             :   DW_IDX_hi_user = 0x3fff
     333             : };
     334             : 
     335             : inline bool isUnitType(uint8_t UnitType) {
     336           8 :   switch (UnitType) {
     337             :   case DW_UT_compile:
     338             :   case DW_UT_type:
     339             :   case DW_UT_partial:
     340             :   case DW_UT_skeleton:
     341             :   case DW_UT_split_compile:
     342             :   case DW_UT_split_type:
     343             :     return true;
     344           2 :   default:
     345             :     return false;
     346             :   }
     347             : }
     348             : 
     349             : inline bool isUnitType(dwarf::Tag T) {
     350             :   switch (T) {
     351             :   case DW_TAG_compile_unit:
     352             :   case DW_TAG_type_unit:
     353             :   case DW_TAG_partial_unit:
     354             :   case DW_TAG_skeleton_unit:
     355             :     return true;
     356           0 :   default:
     357             :     return false;
     358             :   }
     359             : }
     360             : 
     361             : // Constants for the DWARF v5 Accelerator Table Proposal
     362             : enum AcceleratorTable {
     363             :   // Data layout descriptors.
     364             :   DW_ATOM_null = 0u,       ///  Marker as the end of a list of atoms.
     365             :   DW_ATOM_die_offset = 1u, // DIE offset in the debug_info section.
     366             :   DW_ATOM_cu_offset = 2u, // Offset of the compile unit header that contains the
     367             :                           // item in question.
     368             :   DW_ATOM_die_tag = 3u,   // A tag entry.
     369             :   DW_ATOM_type_flags = 4u, // Set of flags for a type.
     370             : 
     371             :   DW_ATOM_type_type_flags = 5u, // Dsymutil type extension.
     372             :   DW_ATOM_qual_name_hash = 6u,  // Dsymutil qualified hash extension.
     373             : 
     374             :   // DW_ATOM_type_flags values.
     375             : 
     376             :   // Always set for C++, only set for ObjC if this is the @implementation for a
     377             :   // class.
     378             :   DW_FLAG_type_implementation = 2u,
     379             : 
     380             :   // Hash functions.
     381             : 
     382             :   // Daniel J. Bernstein hash.
     383             :   DW_hash_function_djb = 0u
     384             : };
     385             : 
     386             : // Constants for the GNU pubnames/pubtypes extensions supporting gdb index.
     387             : enum GDBIndexEntryKind {
     388             :   GIEK_NONE,
     389             :   GIEK_TYPE,
     390             :   GIEK_VARIABLE,
     391             :   GIEK_FUNCTION,
     392             :   GIEK_OTHER,
     393             :   GIEK_UNUSED5,
     394             :   GIEK_UNUSED6,
     395             :   GIEK_UNUSED7
     396             : };
     397             : 
     398             : enum GDBIndexEntryLinkage { GIEL_EXTERNAL, GIEL_STATIC };
     399             : 
     400             : /// \defgroup DwarfConstantsDumping Dwarf constants dumping functions
     401             : ///
     402             : /// All these functions map their argument's value back to the
     403             : /// corresponding enumerator name or return nullptr if the value isn't
     404             : /// known.
     405             : ///
     406             : /// @{
     407             : StringRef TagString(unsigned Tag);
     408             : StringRef ChildrenString(unsigned Children);
     409             : StringRef AttributeString(unsigned Attribute);
     410             : StringRef FormEncodingString(unsigned Encoding);
     411             : StringRef OperationEncodingString(unsigned Encoding);
     412             : StringRef AttributeEncodingString(unsigned Encoding);
     413             : StringRef DecimalSignString(unsigned Sign);
     414             : StringRef EndianityString(unsigned Endian);
     415             : StringRef AccessibilityString(unsigned Access);
     416             : StringRef VisibilityString(unsigned Visibility);
     417             : StringRef VirtualityString(unsigned Virtuality);
     418             : StringRef LanguageString(unsigned Language);
     419             : StringRef CaseString(unsigned Case);
     420             : StringRef ConventionString(unsigned Convention);
     421             : StringRef InlineCodeString(unsigned Code);
     422             : StringRef ArrayOrderString(unsigned Order);
     423             : StringRef LNStandardString(unsigned Standard);
     424             : StringRef LNExtendedString(unsigned Encoding);
     425             : StringRef MacinfoString(unsigned Encoding);
     426             : StringRef CallFrameString(unsigned Encoding);
     427             : StringRef ApplePropertyString(unsigned);
     428             : StringRef UnitTypeString(unsigned);
     429             : StringRef AtomTypeString(unsigned Atom);
     430             : StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind);
     431             : StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
     432             : StringRef IndexString(unsigned Idx);
     433             : /// @}
     434             : 
     435             : /// \defgroup DwarfConstantsParsing Dwarf constants parsing functions
     436             : ///
     437             : /// These functions map their strings back to the corresponding enumeration
     438             : /// value or return 0 if there is none, except for these exceptions:
     439             : ///
     440             : /// \li \a getTag() returns \a DW_TAG_invalid on invalid input.
     441             : /// \li \a getVirtuality() returns \a DW_VIRTUALITY_invalid on invalid input.
     442             : /// \li \a getMacinfo() returns \a DW_MACINFO_invalid on invalid input.
     443             : ///
     444             : /// @{
     445             : unsigned getTag(StringRef TagString);
     446             : unsigned getOperationEncoding(StringRef OperationEncodingString);
     447             : unsigned getVirtuality(StringRef VirtualityString);
     448             : unsigned getLanguage(StringRef LanguageString);
     449             : unsigned getCallingConvention(StringRef LanguageString);
     450             : unsigned getAttributeEncoding(StringRef EncodingString);
     451             : unsigned getMacinfo(StringRef MacinfoString);
     452             : /// @}
     453             : 
     454             : /// \defgroup DwarfConstantsVersioning Dwarf version for constants
     455             : ///
     456             : /// For constants defined by DWARF, returns the DWARF version when the constant
     457             : /// was first defined. For vendor extensions, if there is a version-related
     458             : /// policy for when to emit it, returns a version number for that policy.
     459             : /// Otherwise returns 0.
     460             : ///
     461             : /// @{
     462             : unsigned TagVersion(Tag T);
     463             : unsigned AttributeVersion(Attribute A);
     464             : unsigned FormVersion(Form F);
     465             : unsigned OperationVersion(LocationAtom O);
     466             : unsigned AttributeEncodingVersion(TypeKind E);
     467             : unsigned LanguageVersion(SourceLanguage L);
     468             : /// @}
     469             : 
     470             : /// \defgroup DwarfConstantsVendor Dwarf "vendor" for constants
     471             : ///
     472             : /// These functions return an identifier describing "who" defined the constant,
     473             : /// either the DWARF standard itself or the vendor who defined the extension.
     474             : ///
     475             : /// @{
     476             : unsigned TagVendor(Tag T);
     477             : unsigned AttributeVendor(Attribute A);
     478             : unsigned FormVendor(Form F);
     479             : unsigned OperationVendor(LocationAtom O);
     480             : unsigned AttributeEncodingVendor(TypeKind E);
     481             : unsigned LanguageVendor(SourceLanguage L);
     482             : /// @}
     483             : 
     484             : /// Tells whether the specified form is defined in the specified version,
     485             : /// or is an extension if extensions are allowed.
     486             : bool isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk = true);
     487             : 
     488             : /// Returns the symbolic string representing Val when used as a value
     489             : /// for attribute Attr.
     490             : StringRef AttributeValueString(uint16_t Attr, unsigned Val);
     491             : 
     492             : /// Describes an entry of the various gnu_pub* debug sections.
     493             : ///
     494             : /// The gnu_pub* kind looks like:
     495             : ///
     496             : /// 0-3  reserved
     497             : /// 4-6  symbol kind
     498             : /// 7    0 == global, 1 == static
     499             : ///
     500             : /// A gdb_index descriptor includes the above kind, shifted 24 bits up with the
     501             : /// offset of the cu within the debug_info section stored in those 24 bits.
     502             : struct PubIndexEntryDescriptor {
     503             :   GDBIndexEntryKind Kind;
     504             :   GDBIndexEntryLinkage Linkage;
     505             :   PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
     506             :       : Kind(Kind), Linkage(Linkage) {}
     507             :   /* implicit */ PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
     508             :       : Kind(Kind), Linkage(GIEL_EXTERNAL) {}
     509             :   explicit PubIndexEntryDescriptor(uint8_t Value)
     510         621 :       : Kind(
     511         621 :             static_cast<GDBIndexEntryKind>((Value & KIND_MASK) >> KIND_OFFSET)),
     512         621 :         Linkage(static_cast<GDBIndexEntryLinkage>((Value & LINKAGE_MASK) >>
     513        1242 :                                                   LINKAGE_OFFSET)) {}
     514             :   uint8_t toBits() const {
     515          62 :     return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET;
     516             :   }
     517             : 
     518             : private:
     519             :   enum {
     520             :     KIND_OFFSET = 4,
     521             :     KIND_MASK = 7 << KIND_OFFSET,
     522             :     LINKAGE_OFFSET = 7,
     523             :     LINKAGE_MASK = 1 << LINKAGE_OFFSET
     524             :   };
     525             : };
     526             : 
     527             : /// Constants that define the DWARF format as 32 or 64 bit.
     528             : enum DwarfFormat : uint8_t { DWARF32, DWARF64 };
     529             : 
     530             : } // End of namespace dwarf
     531             : 
     532             : } // End of namespace llvm
     533             : 
     534             : #endif

Generated by: LCOV version 1.13