[InstCombine] Signed saturation patterns
[llvm-core.git] / tools / llvm-cov / CoverageExporter.h
blob751e55dc091618df8458e88a194742f714342008
1 //===- CoverageExporter.h - Code coverage exporter ------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
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"
21 namespace llvm {
23 /// Exports the code coverage information.
24 class CoverageExporter {
25 protected:
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.
33 raw_ostream &OS;
35 CoverageExporter(const coverage::CoverageMapping &CoverageMapping,
36 const CoverageViewOptions &Options, raw_ostream &OS)
37 : Coverage(CoverageMapping), Options(Options), OS(OS) {}
39 public:
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