summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/SourceCoverageView.cpp
diff options
context:
space:
mode:
authorYing Yi <maggieyi666@gmail.com>2016-08-24 14:27:23 +0000
committerYing Yi <maggieyi666@gmail.com>2016-08-24 14:27:23 +0000
commit84dc971ee2bc444a41d01051dba5b83d103ad952 (patch)
treeed2637dc11ef83639d3aa81a281d6463dc8882fd /llvm/tools/llvm-cov/SourceCoverageView.cpp
parentc22e32deac405e042ffe4f05bf01bd5b6e3aa536 (diff)
downloadbcm5719-llvm-84dc971ee2bc444a41d01051dba5b83d103ad952.tar.gz
bcm5719-llvm-84dc971ee2bc444a41d01051dba5b83d103ad952.zip
[llvm-cov] Add the project summary to each source file coverage report.
This patch includes the following changes: - Included header "Code coverage report" and include the date that the report was created. - Included title (as specified in a command line option, (i.e llvm-cov -project-title="Simple Test") - In the summary, list the elf files that the source code file has contributed to. - Used column heading for "Line No.", "Count No.", Source". Differential Revision: https://reviews.llvm.org/D23345 llvm-svn: 279628
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageView.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp
index 6fab1afd6b6..23f725fccdc 100644
--- a/llvm/tools/llvm-cov/SourceCoverageView.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp
@@ -109,14 +109,15 @@ bool SourceCoverageView::hasSubViews() const {
std::unique_ptr<SourceCoverageView>
SourceCoverageView::create(StringRef SourceName, const MemoryBuffer &File,
const CoverageViewOptions &Options,
- coverage::CoverageData &&CoverageInfo) {
+ coverage::CoverageData &&CoverageInfo,
+ bool FunctionView) {
switch (Options.Format) {
case CoverageViewOptions::OutputFormat::Text:
- return llvm::make_unique<SourceCoverageViewText>(SourceName, File, Options,
- std::move(CoverageInfo));
+ return llvm::make_unique<SourceCoverageViewText>(
+ SourceName, File, Options, std::move(CoverageInfo), FunctionView);
case CoverageViewOptions::OutputFormat::HTML:
- return llvm::make_unique<SourceCoverageViewHTML>(SourceName, File, Options,
- std::move(CoverageInfo));
+ return llvm::make_unique<SourceCoverageViewHTML>(
+ SourceName, File, Options, std::move(CoverageInfo), FunctionView);
}
llvm_unreachable("Unknown coverage output format!");
}
@@ -135,11 +136,15 @@ void SourceCoverageView::addInstantiation(
void SourceCoverageView::print(raw_ostream &OS, bool WholeFile,
bool ShowSourceName, unsigned ViewDepth) {
- if (ShowSourceName)
- renderSourceName(OS);
+ if (WholeFile)
+ renderCellInTitle(OS, "Code Coverage Report");
renderViewHeader(OS);
+ if (ShowSourceName)
+ renderSourceName(OS, WholeFile);
+
+ renderTableHeader(OS, ViewDepth);
// We need the expansions and instantiations sorted so we can go through them
// while we iterate lines.
std::sort(ExpansionSubViews.begin(), ExpansionSubViews.end());
OpenPOWER on IntegriCloud