[llvm] [mlir] [llvm-cov] Add inline exclusion marker support for coverage reporting (PR #203723)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 13 12:44:09 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/test/tools/llvm-cov/Inputs/exclude-markers-custom-region/report-custom-region.cpp llvm/test/tools/llvm-cov/Inputs/exclude-markers-custom/report-custom.cpp llvm/test/tools/llvm-cov/Inputs/exclude-markers-region/report-region.cpp llvm/test/tools/llvm-cov/Inputs/exclude-markers/report.cpp llvm/tools/llvm-cov/CodeCoverage.cpp llvm/tools/llvm-cov/CoverageReport.cpp llvm/tools/llvm-cov/CoverageSummaryInfo.h llvm/tools/llvm-cov/CoverageViewOptions.h mlir/tools/mlir-tblgen/OpDocGen.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index 2fc4f18b5..962b1000b 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -756,8 +756,8 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) {
cl::opt<std::string> ExcludeRegionStopRegex(
"exclude-region-stop-regex", cl::Optional,
- cl::desc("End of an excluded region"),
- cl::init("LCOV_EXCL_STOP"), cl::cat(FilteringCategory));
+ cl::desc("End of an excluded region"), cl::init("LCOV_EXCL_STOP"),
+ cl::cat(FilteringCategory));
cl::opt<double> RegionCoverageLtFilter(
"region-coverage-lt", cl::Optional,
@@ -967,8 +967,7 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) {
RE, NameRegexCoverageFilter::FilterType::Include));
if (!ExcludeLineRegex.empty())
- ViewOpts.ExcludeLineRE =
- std::make_shared<Regex>(ExcludeLineRegex);
+ ViewOpts.ExcludeLineRE = std::make_shared<Regex>(ExcludeLineRegex);
if (!ExcludeRegionStartRegex.empty())
ViewOpts.ExcludeRegionStartRE =
std::make_shared<Regex>(ExcludeRegionStartRegex);
``````````
</details>
https://github.com/llvm/llvm-project/pull/203723
More information about the llvm-commits
mailing list