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

          Line data    Source code
       1             : //===- DWARFObject.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_DWARF_DWARFOBJECT_H
      11             : #define LLVM_DEBUGINFO_DWARF_DWARFOBJECT_H
      12             : 
      13             : #include "llvm/DebugInfo/DWARF/DWARFSection.h"
      14             : #include "llvm/Object/ObjectFile.h"
      15             : 
      16             : namespace llvm {
      17             : // This is responsible for low level access to the object file. It
      18             : // knows how to find the required sections and compute relocated
      19             : // values.
      20             : // The default implementations of the get<Section> methods return dummy values.
      21             : // This is to allow clients that only need some of those to implement just the
      22             : // ones they need. We can't use unreachable for as many cases because the parser
      23             : // implementation is eager and will call some of these methods even if the
      24             : // result is not used.
      25        2018 : class DWARFObject {
      26             :   DWARFSection Dummy;
      27             : 
      28             : public:
      29             :   virtual ~DWARFObject() = default;
      30           0 :   virtual StringRef getFileName() const { llvm_unreachable("unimplemented"); }
      31           0 :   virtual const object::ObjectFile *getFile() const { return nullptr; }
      32           0 :   virtual ArrayRef<SectionName> getSectionNames() const { return {}; }
      33             :   virtual bool isLittleEndian() const = 0;
      34           0 :   virtual uint8_t getAddressSize() const { llvm_unreachable("unimplemented"); }
      35           0 :   virtual const DWARFSection &getInfoSection() const { return Dummy; }
      36             :   virtual void
      37           0 :   forEachTypesSections(function_ref<void(const DWARFSection &)> F) const {}
      38           0 :   virtual StringRef getAbbrevSection() const { return ""; }
      39           0 :   virtual const DWARFSection &getLocSection() const { return Dummy; }
      40           0 :   virtual StringRef getARangeSection() const { return ""; }
      41           0 :   virtual StringRef getDebugFrameSection() const { return ""; }
      42           0 :   virtual StringRef getEHFrameSection() const { return ""; }
      43           0 :   virtual const DWARFSection &getLineSection() const { return Dummy; }
      44           0 :   virtual StringRef getStringSection() const { return ""; }
      45           0 :   virtual const DWARFSection &getRangeSection() const { return Dummy; }
      46           0 :   virtual StringRef getMacinfoSection() const { return ""; }
      47           0 :   virtual StringRef getPubNamesSection() const { return ""; }
      48           0 :   virtual StringRef getPubTypesSection() const { return ""; }
      49           0 :   virtual StringRef getGnuPubNamesSection() const { return ""; }
      50           0 :   virtual StringRef getGnuPubTypesSection() const { return ""; }
      51          18 :   virtual const DWARFSection &getStringOffsetSection() const { return Dummy; }
      52           0 :   virtual const DWARFSection &getInfoDWOSection() const { return Dummy; }
      53             :   virtual void
      54           0 :   forEachTypesDWOSections(function_ref<void(const DWARFSection &)> F) const {}
      55           0 :   virtual StringRef getAbbrevDWOSection() const { return ""; }
      56           0 :   virtual const DWARFSection &getLineDWOSection() const { return Dummy; }
      57           0 :   virtual const DWARFSection &getLocDWOSection() const { return Dummy; }
      58           0 :   virtual StringRef getStringDWOSection() const { return ""; }
      59           0 :   virtual const DWARFSection &getStringOffsetDWOSection() const {
      60           0 :     return Dummy;
      61             :   }
      62           0 :   virtual const DWARFSection &getRangeDWOSection() const { return Dummy; }
      63          18 :   virtual const DWARFSection &getAddrSection() const { return Dummy; }
      64           0 :   virtual const DWARFSection &getAppleNamesSection() const { return Dummy; }
      65           0 :   virtual const DWARFSection &getAppleTypesSection() const { return Dummy; }
      66           0 :   virtual const DWARFSection &getAppleNamespacesSection() const {
      67           0 :     return Dummy;
      68             :   }
      69           0 :   virtual const DWARFSection &getAppleObjCSection() const { return Dummy; }
      70           0 :   virtual StringRef getCUIndexSection() const { return ""; }
      71           0 :   virtual StringRef getGdbIndexSection() const { return ""; }
      72           0 :   virtual StringRef getTUIndexSection() const { return ""; }
      73             :   virtual Optional<RelocAddrEntry> find(const DWARFSection &Sec,
      74             :                                         uint64_t Pos) const = 0;
      75             : };
      76             : 
      77             : } // namespace llvm
      78             : #endif

Generated by: LCOV version 1.13