1 //===- CoverageReport.h - Code coverage report ---------------------------===//
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 implements rendering of a code coverage report.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_COV_COVERAGEREPORT_H
15 #define LLVM_COV_COVERAGEREPORT_H
17 #include "CoverageSummaryInfo.h"
18 #include "CoverageViewOptions.h"
22 /// \brief Displays the code coverage report.
23 class CoverageReport {
24 const CoverageViewOptions &Options;
25 const coverage::CoverageMapping &Coverage;
27 void render(const FileCoverageSummary &File, raw_ostream &OS) const;
28 void render(const FunctionCoverageSummary &Function, raw_ostream &OS) const;
31 CoverageReport(const CoverageViewOptions &Options,
32 const coverage::CoverageMapping &Coverage)
33 : Options(Options), Coverage(Coverage) {}
35 void renderFunctionReports(ArrayRef<std::string> Files, raw_ostream &OS);
37 /// Prepare file reports for the files specified in \p Files.
38 static std::vector<FileCoverageSummary>
39 prepareFileReports(const coverage::CoverageMapping &Coverage,
40 FileCoverageSummary &Totals, ArrayRef<std::string> Files);
42 /// Render file reports for every unique file in the coverage mapping.
43 void renderFileReports(raw_ostream &OS) const;
45 /// Render file reports for the files specified in \p Files.
46 void renderFileReports(raw_ostream &OS, ArrayRef<std::string> Files) const;
49 } // end namespace llvm
51 #endif // LLVM_COV_COVERAGEREPORT_H