1 //===- CoverageSummary.h - Code coverage summary --------------------------===//
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 data management and rendering for the code coverage
11 // summaries of all files and functions.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_COV_COVERAGESUMMARY_H
16 #define LLVM_COV_COVERAGESUMMARY_H
18 #include "CoverageSummaryInfo.h"
23 /// \brief Manager for the function and file code coverage summaries.
24 class CoverageSummary {
25 std::vector<StringRef> Filenames;
26 std::vector<FunctionCoverageSummary> FunctionSummaries;
27 std::vector<std::pair<unsigned, unsigned>> FunctionSummariesFileIDs;
28 std::vector<FileCoverageSummary> FileSummaries;
30 unsigned getFileID(StringRef Filename);
33 void createSummaries(ArrayRef<coverage::FunctionRecord> Functions);
35 ArrayRef<FileCoverageSummary> getFileSummaries() { return FileSummaries; }
37 FileCoverageSummary getCombinedFileSummaries();
39 void render(const FunctionCoverageSummary &Summary, raw_ostream &OS);
41 void render(raw_ostream &OS);
45 #endif // LLVM_COV_COVERAGESUMMARY_H