1 //===- CoverageExporter.h - Code coverage exporter ------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class defines a code coverage exporter interface.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_COV_COVERAGEEXPORTER_H
15 #define LLVM_COV_COVERAGEEXPORTER_H
17 #include "CoverageFilters.h"
18 #include "CoverageSummaryInfo.h"
19 #include "CoverageViewOptions.h"
20 #include "llvm/ProfileData/Coverage/CoverageMapping.h"
24 /// Exports the code coverage information.
25 class CoverageExporter {
27 /// The full CoverageMapping object to export.
28 const coverage::CoverageMapping &Coverage;
30 /// The options passed to the tool.
31 const CoverageViewOptions &Options;
33 /// Output stream to print JSON to.
36 CoverageExporter(const coverage::CoverageMapping &CoverageMapping,
37 const CoverageViewOptions &Options, raw_ostream &OS)
38 : Coverage(CoverageMapping), Options(Options), OS(OS) {}
41 virtual ~CoverageExporter(){};
43 /// Render the CoverageMapping object.
44 virtual void renderRoot(const CoverageFilters &IgnoreFilenameFilters) = 0;
46 /// Render the CoverageMapping object for specified source files.
47 virtual void renderRoot(const std::vector<std::string> &SourceFiles) = 0;
50 } // end namespace llvm
52 #endif // LLVM_COV_COVERAGEEXPORTER_H