blob: 7ec3df90b8f92d32dc10cceef06bfbbec75896fd [file] [log] [blame]
Alex Lorenze82d89c2014-08-22 22:56:03 +00001//===- CoverageReport.h - Code coverage report ---------------------------===//
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 implements rendering of a code coverage report.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_COV_COVERAGEREPORT_H
15#define LLVM_COV_COVERAGEREPORT_H
16
Justin Bognerf91bc6c2015-02-14 02:01:24 +000017#include "CoverageSummaryInfo.h"
Chandler Carruthd9903882015-01-14 11:23:27 +000018#include "CoverageViewOptions.h"
Alex Lorenze82d89c2014-08-22 22:56:03 +000019
20namespace llvm {
21
22/// \brief Displays the code coverage report.
23class CoverageReport {
24 const CoverageViewOptions &Options;
Justin Bognerf91bc6c2015-02-14 02:01:24 +000025 std::unique_ptr<coverage::CoverageMapping> Coverage;
Alex Lorenze82d89c2014-08-22 22:56:03 +000026
27 void render(const FileCoverageSummary &File, raw_ostream &OS);
28 void render(const FunctionCoverageSummary &Function, raw_ostream &OS);
29
30public:
Justin Bognerf91bc6c2015-02-14 02:01:24 +000031 CoverageReport(const CoverageViewOptions &Options,
32 std::unique_ptr<coverage::CoverageMapping> Coverage)
33 : Options(Options), Coverage(std::move(Coverage)) {}
Alex Lorenze82d89c2014-08-22 22:56:03 +000034
Justin Bogner0ef7a2a2015-02-14 02:05:05 +000035 void renderFunctionReports(ArrayRef<std::string> Files, raw_ostream &OS);
Alex Lorenze82d89c2014-08-22 22:56:03 +000036
37 void renderFileReports(raw_ostream &OS);
38};
39}
40
41#endif // LLVM_COV_COVERAGEREPORT_H