Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 1 | //===- 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 Bogner | f91bc6c | 2015-02-14 02:01:24 +0000 | [diff] [blame] | 17 | #include "CoverageSummaryInfo.h" |
Chandler Carruth | d990388 | 2015-01-14 11:23:27 +0000 | [diff] [blame] | 18 | #include "CoverageViewOptions.h" |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
| 21 | |
| 22 | /// \brief Displays the code coverage report. |
| 23 | class CoverageReport { |
| 24 | const CoverageViewOptions &Options; |
Justin Bogner | f91bc6c | 2015-02-14 02:01:24 +0000 | [diff] [blame] | 25 | std::unique_ptr<coverage::CoverageMapping> Coverage; |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 26 | |
| 27 | void render(const FileCoverageSummary &File, raw_ostream &OS); |
| 28 | void render(const FunctionCoverageSummary &Function, raw_ostream &OS); |
| 29 | |
| 30 | public: |
Justin Bogner | f91bc6c | 2015-02-14 02:01:24 +0000 | [diff] [blame] | 31 | CoverageReport(const CoverageViewOptions &Options, |
| 32 | std::unique_ptr<coverage::CoverageMapping> Coverage) |
| 33 | : Options(Options), Coverage(std::move(Coverage)) {} |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 34 | |
Justin Bogner | 0ef7a2a | 2015-02-14 02:05:05 +0000 | [diff] [blame] | 35 | void renderFunctionReports(ArrayRef<std::string> Files, raw_ostream &OS); |
Alex Lorenz | e82d89c | 2014-08-22 22:56:03 +0000 | [diff] [blame] | 36 | |
| 37 | void renderFileReports(raw_ostream &OS); |
| 38 | }; |
| 39 | } |
| 40 | |
| 41 | #endif // LLVM_COV_COVERAGEREPORT_H |