LCOV - code coverage report
Current view: top level - lib/BinaryFormat - Dwarf.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 134 269 49.8 %
Date: 2017-09-14 15:23:50 Functions: 28 47 59.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- llvm/BinaryFormat/Dwarf.cpp - Dwarf Framework ------------*- 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             : // This file contains support for generic dwarf information.
      11             : //
      12             : //===----------------------------------------------------------------------===//
      13             : 
      14             : #include "llvm/BinaryFormat/Dwarf.h"
      15             : #include "llvm/ADT/StringSwitch.h"
      16             : #include "llvm/Support/ErrorHandling.h"
      17             : 
      18             : using namespace llvm;
      19             : using namespace dwarf;
      20             : 
      21       20437 : StringRef llvm::dwarf::TagString(unsigned Tag) {
      22       20437 :   switch (Tag) {
      23          16 :   default:
      24          16 :     return StringRef();
      25             : #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR)                               \
      26             :   case DW_TAG_##NAME:                                                          \
      27             :     return "DW_TAG_" #NAME;
      28             : #include "llvm/BinaryFormat/Dwarf.def"
      29             :   }
      30             : }
      31             : 
      32        2959 : unsigned llvm::dwarf::getTag(StringRef TagString) {
      33        2959 :   return StringSwitch<unsigned>(TagString)
      34             : #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR)                               \
      35             :   .Case("DW_TAG_" #NAME, DW_TAG_##NAME)
      36             : #include "llvm/BinaryFormat/Dwarf.def"
      37        8877 :       .Default(DW_TAG_invalid);
      38             : }
      39             : 
      40           0 : unsigned llvm::dwarf::TagVersion(dwarf::Tag Tag) {
      41             :   switch (Tag) {
      42             :   default:
      43             :     return 0;
      44             : #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR)                               \
      45             :   case DW_TAG_##NAME:                                                          \
      46             :     return VERSION;
      47             : #include "llvm/BinaryFormat/Dwarf.def"
      48             :   }
      49             : }
      50             : 
      51           0 : unsigned llvm::dwarf::TagVendor(dwarf::Tag Tag) {
      52           0 :   switch (Tag) {
      53             :   default:
      54             :     return 0;
      55             : #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR)                               \
      56             :   case DW_TAG_##NAME:                                                          \
      57             :     return DWARF_VENDOR_##VENDOR;
      58             : #include "llvm/BinaryFormat/Dwarf.def"
      59             :   }
      60             : }
      61             : 
      62        7878 : StringRef llvm::dwarf::ChildrenString(unsigned Children) {
      63        7878 :   switch (Children) {
      64        4598 :   case DW_CHILDREN_no:
      65        4598 :     return "DW_CHILDREN_no";
      66        3280 :   case DW_CHILDREN_yes:
      67        3280 :     return "DW_CHILDREN_yes";
      68             :   }
      69           0 :   return StringRef();
      70             : }
      71             : 
      72       73344 : StringRef llvm::dwarf::AttributeString(unsigned Attribute) {
      73       73344 :   switch (Attribute) {
      74          83 :   default:
      75          83 :     return StringRef();
      76             : #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR)                                \
      77             :   case DW_AT_##NAME:                                                           \
      78             :     return "DW_AT_" #NAME;
      79             : #include "llvm/BinaryFormat/Dwarf.def"
      80             :   }
      81             : }
      82             : 
      83           0 : unsigned llvm::dwarf::AttributeVersion(dwarf::Attribute Attribute) {
      84             :   switch (Attribute) {
      85             :   default:
      86             :     return 0;
      87             : #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR)                                \
      88             :   case DW_AT_##NAME:                                                           \
      89             :     return VERSION;
      90             : #include "llvm/BinaryFormat/Dwarf.def"
      91             :   }
      92             : }
      93             : 
      94           0 : unsigned llvm::dwarf::AttributeVendor(dwarf::Attribute Attribute) {
      95           0 :   switch (Attribute) {
      96             :   default:
      97             :     return 0;
      98             : #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR)                                \
      99             :   case DW_AT_##NAME:                                                           \
     100             :     return DWARF_VENDOR_##VENDOR;
     101             : #include "llvm/BinaryFormat/Dwarf.def"
     102             :   }
     103             : }
     104             : 
     105       61135 : StringRef llvm::dwarf::FormEncodingString(unsigned Encoding) {
     106       61135 :   switch (Encoding) {
     107           0 :   default:
     108           0 :     return StringRef();
     109             : #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR)                              \
     110             :   case DW_FORM_##NAME:                                                         \
     111             :     return "DW_FORM_" #NAME;
     112             : #include "llvm/BinaryFormat/Dwarf.def"
     113             :   }
     114             : }
     115             : 
     116           0 : unsigned llvm::dwarf::FormVersion(dwarf::Form Form) {
     117             :   switch (Form) {
     118             :   default:
     119             :     return 0;
     120             : #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR)                              \
     121             :   case DW_FORM_##NAME:                                                         \
     122             :     return VERSION;
     123             : #include "llvm/BinaryFormat/Dwarf.def"
     124             :   }
     125             : }
     126             : 
     127           0 : unsigned llvm::dwarf::FormVendor(dwarf::Form Form) {
     128             :   switch (Form) {
     129             :   default:
     130             :     return 0;
     131             : #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR)                              \
     132             :   case DW_FORM_##NAME:                                                         \
     133             :     return DWARF_VENDOR_##VENDOR;
     134             : #include "llvm/BinaryFormat/Dwarf.def"
     135             :   }
     136             : }
     137             : 
     138       17317 : StringRef llvm::dwarf::OperationEncodingString(unsigned Encoding) {
     139       17317 :   switch (Encoding) {
     140           0 :   default:
     141           0 :     return StringRef();
     142             : #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR)                                \
     143             :   case DW_OP_##NAME:                                                           \
     144             :     return "DW_OP_" #NAME;
     145             : #include "llvm/BinaryFormat/Dwarf.def"
     146         105 :   case DW_OP_LLVM_fragment:
     147         105 :     return "DW_OP_LLVM_fragment";
     148             :   }
     149             : }
     150             : 
     151         340 : unsigned llvm::dwarf::getOperationEncoding(StringRef OperationEncodingString) {
     152         340 :   return StringSwitch<unsigned>(OperationEncodingString)
     153             : #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR)                                \
     154             :   .Case("DW_OP_" #NAME, DW_OP_##NAME)
     155             : #include "llvm/BinaryFormat/Dwarf.def"
     156        1020 :       .Case("DW_OP_LLVM_fragment", DW_OP_LLVM_fragment)
     157        1020 :       .Default(0);
     158             : }
     159             : 
     160           0 : unsigned llvm::dwarf::OperationVersion(dwarf::LocationAtom Op) {
     161             :   switch (Op) {
     162             :   default:
     163             :     return 0;
     164             : #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR)                                \
     165             :   case DW_OP_##NAME:                                                           \
     166             :     return VERSION;
     167             : #include "llvm/BinaryFormat/Dwarf.def"
     168             :   }
     169             : }
     170             : 
     171           0 : unsigned llvm::dwarf::OperationVendor(dwarf::LocationAtom Op) {
     172           0 :   switch (Op) {
     173             :   default:
     174             :     return 0;
     175             : #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR)                                \
     176             :   case DW_OP_##NAME:                                                           \
     177             :     return DWARF_VENDOR_##VENDOR;
     178             : #include "llvm/BinaryFormat/Dwarf.def"
     179             :   }
     180             : }
     181             : 
     182        1176 : StringRef llvm::dwarf::AttributeEncodingString(unsigned Encoding) {
     183        1176 :   switch (Encoding) {
     184           3 :   default:
     185           3 :     return StringRef();
     186             : #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR)                               \
     187             :   case DW_ATE_##NAME:                                                          \
     188             :     return "DW_ATE_" #NAME;
     189             : #include "llvm/BinaryFormat/Dwarf.def"
     190             :   }
     191             : }
     192             : 
     193        1101 : unsigned llvm::dwarf::getAttributeEncoding(StringRef EncodingString) {
     194        1101 :   return StringSwitch<unsigned>(EncodingString)
     195             : #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR)                               \
     196             :   .Case("DW_ATE_" #NAME, DW_ATE_##NAME)
     197             : #include "llvm/BinaryFormat/Dwarf.def"
     198        3303 :       .Default(0);
     199             : }
     200             : 
     201           0 : unsigned llvm::dwarf::AttributeEncodingVersion(dwarf::TypeKind ATE) {
     202             :   switch (ATE) {
     203             :   default:
     204             :     return 0;
     205             : #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR)                               \
     206             :   case DW_ATE_##NAME:                                                          \
     207             :     return VERSION;
     208             : #include "llvm/BinaryFormat/Dwarf.def"
     209             :   }
     210             : }
     211             : 
     212           0 : unsigned llvm::dwarf::AttributeEncodingVendor(dwarf::TypeKind ATE) {
     213             :   switch (ATE) {
     214             :   default:
     215             :     return 0;
     216             : #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR)                               \
     217             :   case DW_ATE_##NAME:                                                          \
     218             :     return DWARF_VENDOR_##VENDOR;
     219             : #include "llvm/BinaryFormat/Dwarf.def"
     220             :   }
     221             : }
     222             : 
     223           0 : StringRef llvm::dwarf::DecimalSignString(unsigned Sign) {
     224           0 :   switch (Sign) {
     225           0 :   case DW_DS_unsigned:
     226           0 :     return "DW_DS_unsigned";
     227           0 :   case DW_DS_leading_overpunch:
     228           0 :     return "DW_DS_leading_overpunch";
     229           0 :   case DW_DS_trailing_overpunch:
     230           0 :     return "DW_DS_trailing_overpunch";
     231           0 :   case DW_DS_leading_separate:
     232           0 :     return "DW_DS_leading_separate";
     233           0 :   case DW_DS_trailing_separate:
     234           0 :     return "DW_DS_trailing_separate";
     235             :   }
     236           0 :   return StringRef();
     237             : }
     238             : 
     239           0 : StringRef llvm::dwarf::EndianityString(unsigned Endian) {
     240           0 :   switch (Endian) {
     241           0 :   case DW_END_default:
     242           0 :     return "DW_END_default";
     243           0 :   case DW_END_big:
     244           0 :     return "DW_END_big";
     245           0 :   case DW_END_little:
     246           0 :     return "DW_END_little";
     247           0 :   case DW_END_lo_user:
     248           0 :     return "DW_END_lo_user";
     249           0 :   case DW_END_hi_user:
     250           0 :     return "DW_END_hi_user";
     251             :   }
     252           0 :   return StringRef();
     253             : }
     254             : 
     255         258 : StringRef llvm::dwarf::AccessibilityString(unsigned Access) {
     256         258 :   switch (Access) {
     257             :   // Accessibility codes
     258         176 :   case DW_ACCESS_public:
     259         176 :     return "DW_ACCESS_public";
     260          20 :   case DW_ACCESS_protected:
     261          20 :     return "DW_ACCESS_protected";
     262          62 :   case DW_ACCESS_private:
     263          62 :     return "DW_ACCESS_private";
     264             :   }
     265           0 :   return StringRef();
     266             : }
     267             : 
     268           2 : StringRef llvm::dwarf::VisibilityString(unsigned Visibility) {
     269           2 :   switch (Visibility) {
     270           2 :   case DW_VIS_local:
     271           2 :     return "DW_VIS_local";
     272           0 :   case DW_VIS_exported:
     273           0 :     return "DW_VIS_exported";
     274           0 :   case DW_VIS_qualified:
     275           0 :     return "DW_VIS_qualified";
     276             :   }
     277           0 :   return StringRef();
     278             : }
     279             : 
     280          66 : StringRef llvm::dwarf::VirtualityString(unsigned Virtuality) {
     281          66 :   switch (Virtuality) {
     282           2 :   default:
     283           2 :     return StringRef();
     284             : #define HANDLE_DW_VIRTUALITY(ID, NAME)                                         \
     285             :   case DW_VIRTUALITY_##NAME:                                                   \
     286             :     return "DW_VIRTUALITY_" #NAME;
     287             : #include "llvm/BinaryFormat/Dwarf.def"
     288             :   }
     289             : }
     290             : 
     291          62 : unsigned llvm::dwarf::getVirtuality(StringRef VirtualityString) {
     292          62 :   return StringSwitch<unsigned>(VirtualityString)
     293             : #define HANDLE_DW_VIRTUALITY(ID, NAME)                                         \
     294             :   .Case("DW_VIRTUALITY_" #NAME, DW_VIRTUALITY_##NAME)
     295             : #include "llvm/BinaryFormat/Dwarf.def"
     296         186 :       .Default(DW_VIRTUALITY_invalid);
     297             : }
     298             : 
     299        1529 : StringRef llvm::dwarf::LanguageString(unsigned Language) {
     300        1529 :   switch (Language) {
     301           3 :   default:
     302           3 :     return StringRef();
     303             : #define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR)                              \
     304             :   case DW_LANG_##NAME:                                                         \
     305             :     return "DW_LANG_" #NAME;
     306             : #include "llvm/BinaryFormat/Dwarf.def"
     307             :   }
     308             : }
     309             : 
     310        1421 : unsigned llvm::dwarf::getLanguage(StringRef LanguageString) {
     311        1421 :   return StringSwitch<unsigned>(LanguageString)
     312             : #define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR)                              \
     313             :   .Case("DW_LANG_" #NAME, DW_LANG_##NAME)
     314             : #include "llvm/BinaryFormat/Dwarf.def"
     315        4263 :       .Default(0);
     316             : }
     317             : 
     318           0 : unsigned llvm::dwarf::LanguageVersion(dwarf::SourceLanguage Lang) {
     319             :   switch (Lang) {
     320             :   default:
     321             :     return 0;
     322             : #define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR)                              \
     323             :   case DW_LANG_##NAME:                                                         \
     324             :     return VERSION;
     325             : #include "llvm/BinaryFormat/Dwarf.def"
     326             :   }
     327             : }
     328             : 
     329           0 : unsigned llvm::dwarf::LanguageVendor(dwarf::SourceLanguage Lang) {
     330           0 :   switch (Lang) {
     331             :   default:
     332             :     return 0;
     333             : #define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR)                              \
     334             :   case DW_LANG_##NAME:                                                         \
     335             :     return DWARF_VENDOR_##VENDOR;
     336             : #include "llvm/BinaryFormat/Dwarf.def"
     337             :   }
     338             : }
     339             : 
     340           0 : StringRef llvm::dwarf::CaseString(unsigned Case) {
     341           0 :   switch (Case) {
     342           0 :   case DW_ID_case_sensitive:
     343           0 :     return "DW_ID_case_sensitive";
     344           0 :   case DW_ID_up_case:
     345           0 :     return "DW_ID_up_case";
     346           0 :   case DW_ID_down_case:
     347           0 :     return "DW_ID_down_case";
     348           0 :   case DW_ID_case_insensitive:
     349           0 :     return "DW_ID_case_insensitive";
     350             :   }
     351           0 :   return StringRef();
     352             : }
     353             : 
     354          55 : StringRef llvm::dwarf::ConventionString(unsigned CC) {
     355          55 :   switch (CC) {
     356           0 :   default:
     357           0 :     return StringRef();
     358             : #define HANDLE_DW_CC(ID, NAME)                                                 \
     359             :   case DW_CC_##NAME:                                                           \
     360             :     return "DW_CC_" #NAME;
     361             : #include "llvm/BinaryFormat/Dwarf.def"
     362             :   }
     363             : }
     364             : 
     365          42 : unsigned llvm::dwarf::getCallingConvention(StringRef CCString) {
     366          42 :   return StringSwitch<unsigned>(CCString)
     367             : #define HANDLE_DW_CC(ID, NAME) .Case("DW_CC_" #NAME, DW_CC_##NAME)
     368             : #include "llvm/BinaryFormat/Dwarf.def"
     369         126 :       .Default(0);
     370             : }
     371             : 
     372          72 : StringRef llvm::dwarf::InlineCodeString(unsigned Code) {
     373          72 :   switch (Code) {
     374           0 :   case DW_INL_not_inlined:
     375           0 :     return "DW_INL_not_inlined";
     376          72 :   case DW_INL_inlined:
     377          72 :     return "DW_INL_inlined";
     378           0 :   case DW_INL_declared_not_inlined:
     379           0 :     return "DW_INL_declared_not_inlined";
     380           0 :   case DW_INL_declared_inlined:
     381           0 :     return "DW_INL_declared_inlined";
     382             :   }
     383           0 :   return StringRef();
     384             : }
     385             : 
     386           0 : StringRef llvm::dwarf::ArrayOrderString(unsigned Order) {
     387           0 :   switch (Order) {
     388           0 :   case DW_ORD_row_major:
     389           0 :     return "DW_ORD_row_major";
     390           0 :   case DW_ORD_col_major:
     391           0 :     return "DW_ORD_col_major";
     392             :   }
     393           0 :   return StringRef();
     394             : }
     395             : 
     396           0 : StringRef llvm::dwarf::DiscriminantString(unsigned Discriminant) {
     397           0 :   switch (Discriminant) {
     398           0 :   case DW_DSC_label:
     399           0 :     return "DW_DSC_label";
     400           0 :   case DW_DSC_range:
     401           0 :     return "DW_DSC_range";
     402             :   }
     403           0 :   return StringRef();
     404             : }
     405             : 
     406        2628 : StringRef llvm::dwarf::LNStandardString(unsigned Standard) {
     407        2628 :   switch (Standard) {
     408           0 :   default:
     409           0 :     return StringRef();
     410             : #define HANDLE_DW_LNS(ID, NAME)                                                \
     411             :   case DW_LNS_##NAME:                                                          \
     412             :     return "DW_LNS_" #NAME;
     413             : #include "llvm/BinaryFormat/Dwarf.def"
     414             :   }
     415             : }
     416             : 
     417           0 : StringRef llvm::dwarf::LNExtendedString(unsigned Encoding) {
     418           0 :   switch (Encoding) {
     419           0 :   default:
     420           0 :     return StringRef();
     421             : #define HANDLE_DW_LNE(ID, NAME)                                                \
     422             :   case DW_LNE_##NAME:                                                          \
     423             :     return "DW_LNE_" #NAME;
     424             : #include "llvm/BinaryFormat/Dwarf.def"
     425             :   }
     426             : }
     427             : 
     428        1232 : StringRef llvm::dwarf::MacinfoString(unsigned Encoding) {
     429        1232 :   switch (Encoding) {
     430             :   // Macinfo Type Encodings
     431        1201 :   case DW_MACINFO_define:
     432        1201 :     return "DW_MACINFO_define";
     433          19 :   case DW_MACINFO_undef:
     434          19 :     return "DW_MACINFO_undef";
     435           6 :   case DW_MACINFO_start_file:
     436           6 :     return "DW_MACINFO_start_file";
     437           6 :   case DW_MACINFO_end_file:
     438           6 :     return "DW_MACINFO_end_file";
     439           0 :   case DW_MACINFO_vendor_ext:
     440           0 :     return "DW_MACINFO_vendor_ext";
     441           0 :   case DW_MACINFO_invalid:
     442           0 :     return "DW_MACINFO_invalid";
     443             :   }
     444           0 :   return StringRef();
     445             : }
     446             : 
     447          23 : unsigned llvm::dwarf::getMacinfo(StringRef MacinfoString) {
     448          23 :   return StringSwitch<unsigned>(MacinfoString)
     449          69 :       .Case("DW_MACINFO_define", DW_MACINFO_define)
     450          69 :       .Case("DW_MACINFO_undef", DW_MACINFO_undef)
     451          69 :       .Case("DW_MACINFO_start_file", DW_MACINFO_start_file)
     452          69 :       .Case("DW_MACINFO_end_file", DW_MACINFO_end_file)
     453          69 :       .Case("DW_MACINFO_vendor_ext", DW_MACINFO_vendor_ext)
     454          69 :       .Default(DW_MACINFO_invalid);
     455             : }
     456             : 
     457         382 : StringRef llvm::dwarf::CallFrameString(unsigned Encoding) {
     458         382 :   switch (Encoding) {
     459           0 :   default:
     460           0 :     return StringRef();
     461             : #define HANDLE_DW_CFA(ID, NAME)                                                \
     462             :   case DW_CFA_##NAME:                                                          \
     463             :     return "DW_CFA_" #NAME;
     464             : #include "llvm/BinaryFormat/Dwarf.def"
     465             :   }
     466             : }
     467             : 
     468          98 : StringRef llvm::dwarf::ApplePropertyString(unsigned Prop) {
     469          98 :   switch (Prop) {
     470           0 :   default:
     471           0 :     return StringRef();
     472             : #define HANDLE_DW_APPLE_PROPERTY(ID, NAME)                                     \
     473             :   case DW_APPLE_PROPERTY_##NAME:                                               \
     474             :     return "DW_APPLE_PROPERTY_" #NAME;
     475             : #include "llvm/BinaryFormat/Dwarf.def"
     476             :   }
     477             : }
     478             : 
     479          28 : StringRef llvm::dwarf::UnitTypeString(unsigned UT) {
     480          28 :   switch (UT) {
     481           0 :   default:
     482           0 :     return StringRef();
     483             : #define HANDLE_DW_UT(ID, NAME)                                                 \
     484             :   case DW_UT_##NAME:                                                           \
     485             :     return "DW_UT_" #NAME;
     486             : #include "llvm/BinaryFormat/Dwarf.def"
     487             :   }
     488             : }
     489             : 
     490        1342 : StringRef llvm::dwarf::AtomTypeString(unsigned AT) {
     491        1342 :   switch (AT) {
     492           0 :   case dwarf::DW_ATOM_null:
     493           0 :     return "DW_ATOM_null";
     494         874 :   case dwarf::DW_ATOM_die_offset:
     495         874 :     return "DW_ATOM_die_offset";
     496           0 :   case DW_ATOM_cu_offset:
     497           0 :     return "DW_ATOM_cu_offset";
     498         234 :   case DW_ATOM_die_tag:
     499         234 :     return "DW_ATOM_die_tag";
     500         234 :   case DW_ATOM_type_flags:
     501         234 :     return "DW_ATOM_type_flags";
     502             :   }
     503           0 :   return StringRef();
     504             : }
     505             : 
     506          81 : StringRef llvm::dwarf::GDBIndexEntryKindString(GDBIndexEntryKind Kind) {
     507          81 :   switch (Kind) {
     508           0 :   case GIEK_NONE:
     509           0 :     return "NONE";
     510          32 :   case GIEK_TYPE:
     511          32 :     return "TYPE";
     512          27 :   case GIEK_VARIABLE:
     513          27 :     return "VARIABLE";
     514          22 :   case GIEK_FUNCTION:
     515          22 :     return "FUNCTION";
     516           0 :   case GIEK_OTHER:
     517           0 :     return "OTHER";
     518           0 :   case GIEK_UNUSED5:
     519           0 :     return "UNUSED5";
     520           0 :   case GIEK_UNUSED6:
     521           0 :     return "UNUSED6";
     522           0 :   case GIEK_UNUSED7:
     523           0 :     return "UNUSED7";
     524             :   }
     525           0 :   llvm_unreachable("Unknown GDBIndexEntryKind value");
     526             : }
     527             : 
     528             : StringRef
     529          81 : llvm::dwarf::GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage) {
     530          81 :   switch (Linkage) {
     531          60 :   case GIEL_EXTERNAL:
     532          60 :     return "EXTERNAL";
     533          21 :   case GIEL_STATIC:
     534          21 :     return "STATIC";
     535             :   }
     536           0 :   llvm_unreachable("Unknown GDBIndexEntryLinkage value");
     537             : }
     538             : 
     539        8324 : StringRef llvm::dwarf::AttributeValueString(uint16_t Attr, unsigned Val) {
     540        8324 :   switch (Attr) {
     541         236 :   case DW_AT_accessibility:
     542         236 :     return AccessibilityString(Val);
     543           8 :   case DW_AT_virtuality:
     544           8 :     return VirtualityString(Val);
     545         533 :   case DW_AT_language:
     546         533 :     return LanguageString(Val);
     547         447 :   case DW_AT_encoding:
     548         447 :     return AttributeEncodingString(Val);
     549           0 :   case DW_AT_decimal_sign:
     550           0 :     return DecimalSignString(Val);
     551           0 :   case DW_AT_endianity:
     552           0 :     return EndianityString(Val);
     553           2 :   case DW_AT_visibility:
     554           2 :     return VisibilityString(Val);
     555           0 :   case DW_AT_identifier_case:
     556           0 :     return CaseString(Val);
     557           2 :   case DW_AT_calling_convention:
     558           2 :     return ConventionString(Val);
     559          72 :   case DW_AT_inline:
     560          72 :     return InlineCodeString(Val);
     561           0 :   case DW_AT_ordering:
     562           0 :     return ArrayOrderString(Val);
     563           0 :   case DW_AT_discr_value:
     564           0 :     return DiscriminantString(Val);
     565             :   }
     566             : 
     567        7024 :   return StringRef();
     568             : }
     569             : 
     570           0 : bool llvm::dwarf::isValidFormForVersion(Form F, unsigned Version,
     571             :                                         bool ExtensionsOk) {
     572           0 :   if (FormVendor(F) == DWARF_VENDOR_DWARF) {
     573           0 :     unsigned FV = FormVersion(F);
     574           0 :     return FV > 0 && FV <= Version;
     575             :   }
     576             :   return ExtensionsOk;
     577             : }

Generated by: LCOV version 1.13