LCOV - code coverage report
Current view: top level - include/llvm/DebugInfo/CodeView - TypeCollection.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 22 23 95.7 %
Date: 2018-10-20 13:21:21 Functions: 6 8 75.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- TypeCollection.h - A collection of CodeView type records -*- 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_CODEVIEW_TYPECOLLECTION_H
      11             : #define LLVM_DEBUGINFO_CODEVIEW_TYPECOLLECTION_H
      12             : 
      13             : #include "llvm/ADT/StringRef.h"
      14             : 
      15             : #include "llvm/DebugInfo/CodeView/TypeIndex.h"
      16             : #include "llvm/DebugInfo/CodeView/TypeRecord.h"
      17             : 
      18             : namespace llvm {
      19             : namespace codeview {
      20             : class TypeCollection {
      21             : public:
      22           0 :   virtual ~TypeCollection() = default;
      23             : 
      24         456 :   bool empty() { return size() == 0; }
      25             : 
      26             :   virtual Optional<TypeIndex> getFirst() = 0;
      27             :   virtual Optional<TypeIndex> getNext(TypeIndex Prev) = 0;
      28             : 
      29             :   virtual CVType getType(TypeIndex Index) = 0;
      30             :   virtual StringRef getTypeName(TypeIndex Index) = 0;
      31             :   virtual bool contains(TypeIndex Index) = 0;
      32             :   virtual uint32_t size() = 0;
      33             :   virtual uint32_t capacity() = 0;
      34             : 
      35         190 :   template <typename TFunc> void ForEachRecord(TFunc Func) {
      36         190 :     Optional<TypeIndex> Next = getFirst();
      37             : 
      38        1438 :     while (Next.hasValue()) {
      39        1248 :       TypeIndex N = *Next;
      40        1248 :       Func(N, getType(N));
      41        2496 :       Next = getNext(N);
      42             :     }
      43         190 :   }
      44           5 : };
      45           5 : }
      46             : }
      47          30 : 
      48          25 : #endif

Generated by: LCOV version 1.13