LCOV - code coverage report
Current view: top level - include/llvm/DebugInfo/PDB - IPDBEnumChildren.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 5 16 31.2 %
Date: 2018-10-20 13:21:21 Functions: 1 46 2.2 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- IPDBEnumChildren.h - base interface for child enumerator -*- 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_PDB_IPDBENUMCHILDREN_H
      11             : #define LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
      12             : 
      13             : #include <cassert>
      14             : #include <cstdint>
      15             : #include <memory>
      16             : 
      17             : namespace llvm {
      18             : namespace pdb {
      19             : 
      20             : template <typename ChildType> class IPDBEnumChildren {
      21             : public:
      22             :   using ChildTypePtr = std::unique_ptr<ChildType>;
      23             :   using MyType = IPDBEnumChildren<ChildType>;
      24             : 
      25           0 :   virtual ~IPDBEnumChildren() = default;
      26             : 
      27             :   virtual uint32_t getChildCount() const = 0;
      28             :   virtual ChildTypePtr getChildAtIndex(uint32_t Index) const = 0;
      29             :   virtual ChildTypePtr getNext() = 0;
      30             :   virtual void reset() = 0;
      31             : };
      32             : 
      33             : template <typename ChildType>
      34          18 : class NullEnumerator : public IPDBEnumChildren<ChildType> {
      35           0 :   virtual uint32_t getChildCount() const override { return 0; }
      36             :   virtual std::unique_ptr<ChildType>
      37           0 :   getChildAtIndex(uint32_t Index) const override {
      38           0 :     return nullptr;
      39             :   }
      40           0 :   virtual std::unique_ptr<ChildType> getNext() override {
      41           0 :     return nullptr;
      42             :   }
      43           0 :   virtual void reset() override {}
      44           0 : };
      45             : 
      46          18 : } // end namespace pdb
      47          18 : } // end namespace llvm
      48             : 
      49          18 : #endif // LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H

Generated by: LCOV version 1.13