LCOV - code coverage report
Current view: top level - include/llvm/DebugInfo/DWARF - DWARFDebugAbbrev.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 6 6 100.0 %
Date: 2017-09-14 15:23:50 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- DWARFDebugAbbrev.h ---------------------------------------*- 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             : #ifndef LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
      11             : #define LLVM_DEBUGINFO_DWARFDEBUGABBREV_H
      12             : 
      13             : #include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
      14             : #include "llvm/Support/DataExtractor.h"
      15             : #include <cstdint>
      16             : #include <map>
      17             : #include <vector>
      18             : 
      19             : namespace llvm {
      20             : 
      21             : class raw_ostream;
      22             : 
      23       84367 : class DWARFAbbreviationDeclarationSet {
      24             :   uint32_t Offset;
      25             :   /// Code of the first abbreviation, if all abbreviations in the set have
      26             :   /// consecutive codes. UINT32_MAX otherwise.
      27             :   uint32_t FirstAbbrCode;
      28             :   std::vector<DWARFAbbreviationDeclaration> Decls;
      29             : 
      30             :   using const_iterator =
      31             :       std::vector<DWARFAbbreviationDeclaration>::const_iterator;
      32             : 
      33             : public:
      34             :   DWARFAbbreviationDeclarationSet();
      35             : 
      36             :   uint32_t getOffset() const { return Offset; }
      37             :   void dump(raw_ostream &OS) const;
      38             :   bool extract(DataExtractor Data, uint32_t *OffsetPtr);
      39             : 
      40             :   const DWARFAbbreviationDeclaration *
      41             :   getAbbreviationDeclaration(uint32_t AbbrCode) const;
      42             : 
      43             :   const_iterator begin() const {
      44         317 :     return Decls.begin();
      45             :   }
      46             : 
      47             :   const_iterator end() const {
      48         324 :     return Decls.end();
      49             :   }
      50             : 
      51             : private:
      52             :   void clear();
      53             : };
      54             : 
      55        2026 : class DWARFDebugAbbrev {
      56             :   using DWARFAbbreviationDeclarationSetMap =
      57             :       std::map<uint64_t, DWARFAbbreviationDeclarationSet>;
      58             : 
      59             :   DWARFAbbreviationDeclarationSetMap AbbrDeclSets;
      60             :   mutable DWARFAbbreviationDeclarationSetMap::const_iterator PrevAbbrOffsetPos;
      61             : 
      62             : public:
      63             :   DWARFDebugAbbrev();
      64             : 
      65             :   const DWARFAbbreviationDeclarationSet *
      66             :   getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const;
      67             : 
      68             :   void dump(raw_ostream &OS) const;
      69             :   void extract(DataExtractor Data);
      70             : 
      71             :   DWARFAbbreviationDeclarationSetMap::const_iterator begin() const {
      72          64 :     return AbbrDeclSets.begin();
      73             :   }
      74             : 
      75             :   DWARFAbbreviationDeclarationSetMap::const_iterator end() const {
      76          64 :     return AbbrDeclSets.end();
      77             :   }
      78             : 
      79             : private:
      80             :   void clear();
      81             : };
      82             : 
      83             : } // end namespace llvm
      84             : 
      85             : #endif // LLVM_DEBUGINFO_DWARFDEBUGABBREV_H

Generated by: LCOV version 1.13