[llvm-cov] Allow hiding instantiation/region coverage from summary tables
Region coverage is difficult to explain without going deep into how
coverage is implemented. Instantiation coverage is easier to explain,
but probably not useful in most cases (templates don't exist in C, and
most C++ code contains relatively few templates).
This patch adds the options "-show-region-summary" and
"-show-instantiation-summary" to allow hiding those columns.
"-show-instantiation-summary" is turned off by default.
llvm-svn: 312969
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index 0e3d67e5..5aa27e0 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -608,6 +608,15 @@
cl::list<std::string> DemanglerOpts(
"Xdemangler", cl::desc("<demangler-path>|<demangler-option>"));
+ cl::opt<bool> RegionSummary(
+ "show-region-summary", cl::Optional,
+ cl::desc("Show region statistics in summary table"),
+ cl::init(true));
+
+ cl::opt<bool> InstantiationSummary(
+ "show-instantiation-summary", cl::Optional,
+ cl::desc("Show instantiation statistics in summary table"));
+
auto commandLineParser = [&, this](int argc, const char **argv) -> int {
cl::ParseCommandLineOptions(argc, argv, "LLVM code coverage tool\n");
ViewOpts.Debug = DebugDump;
@@ -718,6 +727,9 @@
::exit(0);
}
+ ViewOpts.ShowRegionSummary = RegionSummary;
+ ViewOpts.ShowInstantiationSummary = InstantiationSummary;
+
return 0;
};