1 //===- CoverageExporter.h - Code coverage exporter ------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This class defines a code coverage exporter interface.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_COV_COVERAGEEXPORTER_H
14 #define LLVM_COV_COVERAGEEXPORTER_H
16 #include "CoverageFilters.h"
17 #include "CoverageSummaryInfo.h"
18 #include "CoverageViewOptions.h"
19 #include "llvm/ProfileData/Coverage/CoverageMapping.h"
23 /// Exports the code coverage information.
24 class CoverageExporter
{
26 /// The full CoverageMapping object to export.
27 const coverage::CoverageMapping
&Coverage
;
29 /// The options passed to the tool.
30 const CoverageViewOptions
&Options
;
32 /// Output stream to print to.
35 CoverageExporter(const coverage::CoverageMapping
&CoverageMapping
,
36 const CoverageViewOptions
&Options
, raw_ostream
&OS
)
37 : Coverage(CoverageMapping
), Options(Options
), OS(OS
) {}
40 virtual ~CoverageExporter(){};
42 /// Render the CoverageMapping object.
43 virtual void renderRoot(const CoverageFilters
&IgnoreFilters
) = 0;
45 /// Render the CoverageMapping object for specified source files.
46 virtual void renderRoot(ArrayRef
<std::string
> SourceFiles
) = 0;
49 } // end namespace llvm
51 #endif // LLVM_COV_COVERAGEEXPORTER_H