Commit Graph

3 Commits

Author SHA1 Message Date
Vedant Kumar fa8fa044ec [Coverage] Emit gap areas in braces-optional statements (PR35387)
Emit a gap area starting after the r-paren location and ending at the
start of the body for the braces-optional statements (for, for-each,
while, etc). The count for the gap area equal to the body's count. This
extends the fix in r317758.

Fixes PR35387, rdar://35570345

Testing: stage2 coverage-enabled build of clang, check-clang
llvm-svn: 319373
2017-11-29 22:25:14 +00:00
Vedant Kumar 2e8c875905 [Coverage] Emit a gap area after if conditions
The area immediately after the closing right-paren of an if condition
should have a count equal to the 'then' block's count. Use a gap region
to set this count, so that region highlighting for the 'then' block
remains precise.

This solves a problem we have with wrapped segments. Consider:

  1| if (false)
  2|   foo();

Without a gap area starting after the condition, the wrapped segment
from line 1 would make it look like line 2 is executed, when it's not.

rdar://35373009

llvm-svn: 317758
2017-11-09 02:33:38 +00:00
Vedant Kumar 9d2a16b9b1 [Coverage] Support for C++17 if initializers
Differential Revision: https://reviews.llvm.org/D25572

llvm-svn: 284293
2016-10-14 23:38:16 +00:00