[PATCH] D46918: [Coverage] Discard the last uncompleted deferred region in a decl

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 15 17:08:35 PDT 2018


vsk created this revision.
vsk added a reviewer: arphaman.

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


https://reviews.llvm.org/D46918

Files:
  lib/CodeGen/CoverageMappingGen.cpp
  test/CoverageMapping/deferred-region.cpp
  test/CoverageMapping/label.cpp
  test/CoverageMapping/moremacros.c
  test/CoverageMapping/trycatch.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46918.146965.patch
Type: text/x-patch
Size: 6169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180516/b77292fc/attachment-0001.bin>


More information about the cfe-commits mailing list