This is an archive of the discontinued LLVM Phabricator instance.

[Coverage] Discard the last uncompleted deferred region in a decl
ClosedPublic

Authored by vsk on May 15 2018, 5:07 PM.

Details

Summary

Discard the last uncompleted deferred region in a decl, if one exists.
This prevents lines at the end of a function containing only whitespace
or closing braces from being marked as uncovered, if they follow a
region terminator (return/break/etc).

The previous behavior was to heuristically complete deferred regions at
the end of a decl. In practice this ended up being too brittle for too
little gain. Users would complain that there was no way to reach full
code coverage because whitespace at the end of a function would be
marked uncovered.

rdar://40238228

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.May 15 2018, 5:07 PM
vsk updated this revision to Diff 147360.May 17 2018, 11:16 AM
  • Add a regression test for switches.
This revision is now accepted and ready to land.May 25 2018, 2:22 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.