Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/llvm-cov/CoverageReport.h
Line
Count
Source
1
//===- CoverageReport.h - Code coverage report ---------------------------===//
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
// This class implements rendering of a code coverage report.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_COV_COVERAGEREPORT_H
15
#define LLVM_COV_COVERAGEREPORT_H
16
17
#include "CoverageFilters.h"
18
#include "CoverageSummaryInfo.h"
19
#include "CoverageViewOptions.h"
20
21
namespace llvm {
22
23
/// \brief Displays the code coverage report.
24
class CoverageReport {
25
  const CoverageViewOptions &Options;
26
  const coverage::CoverageMapping &Coverage;
27
28
  void render(const FileCoverageSummary &File, raw_ostream &OS) const;
29
  void render(const FunctionCoverageSummary &Function, const DemangleCache &DC,
30
              raw_ostream &OS) const;
31
32
public:
33
  CoverageReport(const CoverageViewOptions &Options,
34
                 const coverage::CoverageMapping &Coverage)
35
24
      : Options(Options), Coverage(Coverage) {}
36
37
  void renderFunctionReports(ArrayRef<std::string> Files,
38
                             const DemangleCache &DC, raw_ostream &OS);
39
40
  /// Prepare file reports for the files specified in \p Files.
41
  static std::vector<FileCoverageSummary>
42
  prepareFileReports(const coverage::CoverageMapping &Coverage,
43
                     FileCoverageSummary &Totals, ArrayRef<std::string> Files,
44
                     const CoverageViewOptions &Options,
45
                     const CoverageFilter &Filters = CoverageFiltersMatchAll());
46
47
  /// Render file reports for every unique file in the coverage mapping.
48
  void renderFileReports(raw_ostream &OS) const;
49
50
  /// Render file reports for the files specified in \p Files and the functions
51
  /// in \p Filters.
52
  void renderFileReports(raw_ostream &OS, ArrayRef<std::string> Files,
53
                         const CoverageFilter &Filters) const;
54
};
55
56
} // end namespace llvm
57
58
#endif // LLVM_COV_COVERAGEREPORT_H