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

          Line data    Source code
       1             : //===- DWARFAcceleratorTable.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_DWARFACCELERATORTABLE_H
      11             : #define LLVM_DEBUGINFO_DWARFACCELERATORTABLE_H
      12             : 
      13             : #include "llvm/ADT/SmallVector.h"
      14             : #include "llvm/BinaryFormat/Dwarf.h"
      15             : #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
      16             : #include "llvm/DebugInfo/DWARF/DWARFRelocMap.h"
      17             : #include <cstdint>
      18             : #include <utility>
      19             : 
      20             : namespace llvm {
      21             : 
      22             : class raw_ostream;
      23             : 
      24        1346 : class DWARFAcceleratorTable {
      25             :   struct Header {
      26             :     uint32_t Magic;
      27             :     uint16_t Version;
      28             :     uint16_t HashFunction;
      29             :     uint32_t NumBuckets;
      30             :     uint32_t NumHashes;
      31             :     uint32_t HeaderDataLength;
      32             :   };
      33             : 
      34        2692 :   struct HeaderData {
      35             :     using AtomType = uint16_t;
      36             :     using Form = dwarf::Form;
      37             : 
      38             :     uint32_t DIEOffsetBase;
      39             :     SmallVector<std::pair<AtomType, Form>, 3> Atoms;
      40             :   };
      41             : 
      42             :   struct Header Hdr;
      43             :   struct HeaderData HdrData;
      44             :   DWARFDataExtractor AccelSection;
      45             :   DataExtractor StringSection;
      46             : 
      47             : public:
      48             :   DWARFAcceleratorTable(const DWARFDataExtractor &AccelSection,
      49             :                         DataExtractor StringSection)
      50        1346 :       : AccelSection(AccelSection), StringSection(StringSection) {}
      51             : 
      52             :   bool extract();
      53             :   uint32_t getNumBuckets();
      54             :   uint32_t getNumHashes();
      55             :   uint32_t getSizeHdr();
      56             :   uint32_t getHeaderDataLength();
      57             :   ArrayRef<std::pair<HeaderData::AtomType, HeaderData::Form>> getAtomsDesc();
      58             :   bool validateForms();
      59             : 
      60             :   /// Return information related to the DWARF DIE we're looking for when
      61             :   /// performing a lookup by name.
      62             :   ///
      63             :   /// \param HashDataOffset an offset into the hash data table
      64             :   /// \returns <DieOffset, DieTag>
      65             :   /// DieOffset is the offset into the .debug_info section for the DIE
      66             :   /// related to the input hash data offset.
      67             :   /// DieTag is the tag of the DIE
      68             :   std::pair<uint32_t, dwarf::Tag> readAtoms(uint32_t &HashDataOffset);
      69             :   void dump(raw_ostream &OS) const;
      70             : };
      71             : 
      72             : } // end namespace llvm
      73             : 
      74             : #endif // LLVM_DEBUGINFO_DWARFACCELERATORTABLE_H

Generated by: LCOV version 1.13