[llvm] r294137 - [llvm-cov] Don't show function summaries when filtering by filename (fixes PR31395)
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 5 12:11:08 PST 2017
Author: vedantk
Date: Sun Feb 5 14:11:08 2017
New Revision: 294137
URL: http://llvm.org/viewvc/llvm-project?rev=294137&view=rev
Log:
[llvm-cov] Don't show function summaries when filtering by filename (fixes PR31395)
Modified:
llvm/trunk/docs/CommandGuide/llvm-cov.rst
llvm/trunk/test/tools/llvm-cov/demangle.test
llvm/trunk/test/tools/llvm-cov/report.cpp
llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
Modified: llvm/trunk/docs/CommandGuide/llvm-cov.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-cov.rst?rev=294137&r1=294136&r2=294137&view=diff
==============================================================================
--- llvm/trunk/docs/CommandGuide/llvm-cov.rst (original)
+++ llvm/trunk/docs/CommandGuide/llvm-cov.rst Sun Feb 5 14:11:08 2017
@@ -322,6 +322,10 @@ OPTIONS
universal binary or to use an architecture that does not match a
non-universal binary.
+.. option:: -show-functions
+
+ Show coverage summaries for each function.
+
.. program:: llvm-cov export
.. _llvm-cov-export:
Modified: llvm/trunk/test/tools/llvm-cov/demangle.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/demangle.test?rev=294137&r1=294136&r2=294137&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/demangle.test (original)
+++ llvm/trunk/test/tools/llvm-cov/demangle.test Sun Feb 5 14:11:08 2017
@@ -5,7 +5,7 @@ RUN: llvm-profdata merge %S/Inputs/hideU
RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %t.profdata -Xdemangler sed -Xdemangler 's/_/X/g' -filename-equivalence %S/showTemplateInstantiations.cpp | FileCheck %s
// Check that we demangle names when printing out function summaries.
-RUN: llvm-cov report %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -Xdemangler sed -Xdemangler 's/_/X/g' -filename-equivalence %S/showTemplateInstantiations.cpp | FileCheck %s
+RUN: llvm-cov report -show-functions %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -Xdemangler sed -Xdemangler 's/_/X/g' -filename-equivalence %S/showTemplateInstantiations.cpp | FileCheck %s
CHECK-DAG: XZ4funcIbEiTX
CHECK-DAG: XZ4funcIiEiTX
Modified: llvm/trunk/test/tools/llvm-cov/report.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/report.cpp?rev=294137&r1=294136&r2=294137&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/report.cpp (original)
+++ llvm/trunk/test/tools/llvm-cov/report.cpp Sun Feb 5 14:11:08 2017
@@ -1,6 +1,6 @@
// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence 2>&1 | FileCheck %s
-// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp 2>&1 | FileCheck -check-prefix=FILT %s
-// RUN: llvm-cov report %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp does-not-exist.cpp 2>&1 | FileCheck -check-prefix=FILT %s
+// RUN: llvm-cov report -show-functions %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp 2>&1 | FileCheck -check-prefix=FILT %s
+// RUN: llvm-cov report -show-functions %S/Inputs/report.covmapping -instr-profile %S/Inputs/report.profdata -filename-equivalence report.cpp does-not-exist.cpp 2>&1 | FileCheck -check-prefix=FILT %s
// CHECK: Regions Missed Regions Cover Functions Missed Functions Executed Instantiations Missed Insts. Executed Lines Missed Lines Cover
// CHECK-NEXT: ---
Modified: llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CodeCoverage.cpp?rev=294137&r1=294136&r2=294137&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CodeCoverage.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CodeCoverage.cpp Sun Feb 5 14:11:08 2017
@@ -808,6 +808,10 @@ int CodeCoverageTool::show(int argc, con
int CodeCoverageTool::report(int argc, const char **argv,
CommandLineParserType commandLineParser) {
+ cl::opt<bool> ShowFunctionSummaries(
+ "show-functions", cl::Optional, cl::init(false),
+ cl::desc("Show coverage summaries for each function"));
+
auto Err = commandLineParser(argc, argv);
if (Err)
return Err;
@@ -820,7 +824,7 @@ int CodeCoverageTool::report(int argc, c
return 1;
CoverageReport Report(ViewOpts, *Coverage.get());
- if (SourceFiles.empty())
+ if (!ShowFunctionSummaries)
Report.renderFileReports(llvm::outs());
else
Report.renderFunctionReports(SourceFiles, DC, llvm::outs());
More information about the llvm-commits
mailing list