[all-commits] [llvm/llvm-project] 6e609f: [llvm-cov] Add inline exclusion marker support for...

Maksim Levental via All-commits all-commits at lists.llvm.org
Sat Jun 13 15:23:10 PDT 2026


  Branch: refs/heads/users/makslevental/inline-excl-llvm-cov
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e609f41974655ec289a7cc6a16c5e360986c835
      https://github.com/llvm/llvm-project/commit/6e609f41974655ec289a7cc6a16c5e360986c835
  Author: makslevental <maksim.levental at gmail.com>
  Date:   2026-06-13 (Sat, 13 Jun 2026)

  Changed paths:
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-custom-region/report-custom-region.covmapping
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-custom-region/report-custom-region.cpp
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-custom-region/report-custom-region.profdata
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-custom/report-custom.covmapping
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-custom/report-custom.cpp
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-custom/report-custom.profdata
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-region/report-region.covmapping
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-region/report-region.cpp
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-region/report-region.profdata
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers/report.covmapping
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers/report.cpp
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers/report.profdata
    A llvm/test/tools/llvm-cov/exclude-markers.test
    M llvm/tools/llvm-cov/CodeCoverage.cpp
    M llvm/tools/llvm-cov/CoverageReport.cpp
    M llvm/tools/llvm-cov/CoverageSummaryInfo.h
    M llvm/tools/llvm-cov/CoverageViewOptions.h
    M llvm/tools/llvm-cov/SourceCoverageView.cpp
    M llvm/tools/llvm-cov/SourceCoverageView.h
    M llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
    M llvm/tools/llvm-cov/SourceCoverageViewHTML.h
    M llvm/tools/llvm-cov/SourceCoverageViewText.cpp
    M llvm/tools/llvm-cov/SourceCoverageViewText.h

  Log Message:
  -----------
  [llvm-cov] Add inline exclusion marker support for coverage reporting

Add --exclude-line-regex, --exclude-region-start-regex, and
--exclude-region-stop-regex options to llvm-cov. These allow excluding
lines from coverage totals based on inline source comments.

Defaults: LCOV_EXCL_LINE (single line), LCOV_EXCL_START/LCOV_EXCL_STOP
(region). This brings parity with lcov/gcov's exclusion markers and
kcov's --exclude-line regex support.

The implementation scans source files for markers when loaded, builds a
per-file set of excluded line numbers, and subtracts them from the line
coverage totals in prepareFileReports(). Excluded lines are also hidden
from the "show" output (no count column, no red highlighting).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list