This is an archive of the discontinued LLVM Phabricator instance.

[llvm-cov] Ignore unclosed line segments when setting line counts
ClosedPublic

Authored by vsk on Jul 28 2017, 12:43 PM.

Details

Summary

This patch makes a slight change to the way llvm-cov determines line
execution counts. If there are multiple line segments on a line, the
line count is the max count among the regions which start *and* end on
the line. This avoids an issue posed by deferred regions which start on
the same line as a terminated region, e.g:

if (false)
  return; //< The line count should be 0, even though a new region
          //< starts at the semi-colon.
foo();

Another change is that counts from line segments which don't correspond
to region entries are considered. This enables the first change, and
corrects an outstanding issue (see the showLineExecutionCounts.cpp test
change).

This is related to D35925.

Testing: check-profile, llvm-cov lit tests

Diff Detail