[all-commits] [llvm/llvm-project] 640dec: [CoverageMapping] Fix LineCoverageStats incorrectl...

Maksim Levental via All-commits all-commits at lists.llvm.org
Sat Jun 13 17:39:44 PDT 2026


  Branch: refs/heads/users/makslevental/inline-excl-llvm-cov
  Home:   https://github.com/llvm/llvm-project
  Commit: 640dec9b7fc9159755729f014f34e76bd41703a5
      https://github.com/llvm/llvm-project/commit/640dec9b7fc9159755729f014f34e76bd41703a5
  Author: makslevental <m_levental at apple.com>
  Date:   2026-06-13 (Sat, 13 Jun 2026)

  Changed paths:
    M llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-stop-before-start/report-stop-before-start.covmapping
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-stop-before-start/report-stop-before-start.cpp
    A llvm/test/tools/llvm-cov/Inputs/exclude-markers-stop-before-start/report-stop-before-start.profdata
    M llvm/test/tools/llvm-cov/exclude-markers.test
    M llvm/tools/llvm-cov/CoverageViewOptions.h

  Log Message:
  -----------
  [CoverageMapping] Fix LineCoverageStats incorrectly using gap region count

When a line's wrapping segment is a gap region with count=0, but the
line has non-gap segments with count > 0 (not region entries),
LineCoverageStats incorrectly reports the line as uncovered.

This happens when a zero-count gap region (e.g., from a never-taken
if-branch closing brace) extends past subsequent covered lines. The
fix checks non-gap HasCount segments on the line when MinRegionCount
is 0, using their max count instead of the gap's count.

Also skip initializing ExecutionCount from a gap wrapping segment,
since gap regions should not contribute to the line's execution count.

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