Coverage Report

Created: 2017-09-21 03:39

/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 "CoverageSummaryInfo.h"
18
#include "CoverageViewOptions.h"
19
20
namespace llvm {
21
22
/// \brief Displays the code coverage report.
23
class CoverageReport {
24
  const CoverageViewOptions &Options;
25
  const coverage::CoverageMapping &Coverage;
26
27
  void render(const FileCoverageSummary &File, raw_ostream &OS) const;
28
  void render(const FunctionCoverageSummary &Function, const DemangleCache &DC,
29
              raw_ostream &OS) const;
30
31
public:
32
  CoverageReport(const CoverageViewOptions &Options,
33
                 const coverage::CoverageMapping &Coverage)
34
19
      : Options(Options), Coverage(Coverage) {}
35
36
  void renderFunctionReports(ArrayRef<std::string> Files,
37
                             const DemangleCache &DC, raw_ostream &OS);
38
39
  /// Prepare file reports for the files specified in \p Files.
40
  static std::vector<FileCoverageSummary>
41
  prepareFileReports(const coverage::CoverageMapping &Coverage,
42
                     FileCoverageSummary &Totals, ArrayRef<std::string> Files,
43
                     const CoverageViewOptions &Options);
44
45
  /// Render file reports for every unique file in the coverage mapping.
46
  void renderFileReports(raw_ostream &OS) const;
47
48
  /// Render file reports for the files specified in \p Files.
49
  void renderFileReports(raw_ostream &OS, ArrayRef<std::string> Files) const;
50
};
51
52
} // end namespace llvm
53
54
#endif // LLVM_COV_COVERAGEREPORT_H