Coverage Report

Created: 2018-01-17 21:32

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/llvm-cov/CoverageExporter.h
Line
Count
Source
1
//===- CoverageExporter.h - Code coverage exporter ------------------------===//
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 defines a code coverage exporter interface.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_COV_COVERAGEEXPORTER_H
15
#define LLVM_COV_COVERAGEEXPORTER_H
16
17
#include "CoverageSummaryInfo.h"
18
#include "CoverageViewOptions.h"
19
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
20
21
namespace llvm {
22
23
/// \brief Exports the code coverage information.
24
class CoverageExporter {
25
protected:
26
  /// \brief The full CoverageMapping object to export.
27
  const coverage::CoverageMapping &Coverage;
28
29
  /// \brief The options passed to the tool.
30
  const CoverageViewOptions &Options;
31
32
  /// \brief Output stream to print JSON to.
33
  raw_ostream &OS;
34
35
  CoverageExporter(const coverage::CoverageMapping &CoverageMapping,
36
                   const CoverageViewOptions &Options, raw_ostream &OS)
37
10
      : Coverage(CoverageMapping), Options(Options), OS(OS) {}
38
39
public:
40
10
  virtual ~CoverageExporter(){};
41
42
  /// \brief Render the CoverageMapping object.
43
  virtual void renderRoot() = 0;
44
45
  /// \brief Render the CoverageMapping object for specified source files.
46
  virtual void renderRoot(const std::vector<std::string> &SourceFiles) = 0;
47
};
48
49
} // end namespace llvm
50
51
#endif // LLVM_COV_COVERAGEEXPORTER_H