aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/CodeCoverage.cpp
diff options
context:
space:
mode:
authorAlan Phipps <a-phipps@ti.com>2022-10-14 16:08:34 -0500
committerAlan Phipps <a-phipps@ti.com>2022-10-14 16:24:41 -0500
commita921d6eb3b517ef6dcefd13cfbb9a017b00a06b1 (patch)
treeb5b06d55ded8e822ab0bedb7a50edae5adf742dd /llvm/tools/llvm-cov/CodeCoverage.cpp
parent705e77abed0b0fb7c6ab268866d3f841838eaf97 (diff)
downloadllvm-a921d6eb3b517ef6dcefd13cfbb9a017b00a06b1.zip
llvm-a921d6eb3b517ef6dcefd13cfbb9a017b00a06b1.tar.gz
llvm-a921d6eb3b517ef6dcefd13cfbb9a017b00a06b1.tar.bz2
[llvm-cov] Allow branch coverage to be skipped when exporting for LCOV
This small patch adds a '--skip-branches' option to the llvm-cov export options. This option allows branch coverage information to be skipped from the exported LCOV directives if it's not needed. For now, this only works when exporting LCOV (which is noted in the option description), but it can be extended for JSON later if it makes sense. Differential Revision: https://reviews.llvm.org/D135986
Diffstat (limited to 'llvm/tools/llvm-cov/CodeCoverage.cpp')
-rw-r--r--llvm/tools/llvm-cov/CodeCoverage.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index c963a60..9f19dd2 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -1192,12 +1192,17 @@ int CodeCoverageTool::doExport(int argc, const char **argv,
cl::desc("Don't export per-function data"),
cl::cat(ExportCategory));
+ cl::opt<bool> SkipBranches("skip-branches", cl::Optional,
+ cl::desc("Don't export branch data (LCOV)"),
+ cl::cat(ExportCategory));
+
auto Err = commandLineParser(argc, argv);
if (Err)
return Err;
ViewOpts.SkipExpansions = SkipExpansions;
ViewOpts.SkipFunctions = SkipFunctions;
+ ViewOpts.SkipBranches = SkipBranches;
if (ViewOpts.Format != CoverageViewOptions::OutputFormat::Text &&
ViewOpts.Format != CoverageViewOptions::OutputFormat::Lcov) {