Commit Graph

2 Commits

Author SHA1 Message Date
Vedant Kumar
7094a64f9a [Coverage] Audit uses of getCurrentCounter() (SR-4453)
We use getCurrentCounter() in one spot where there isn't guaranteed to
be an active region: the `else' part of an IfExpr in a TopLevelCodeDecl.

Fix this issue by assigning a pseudo-counter to the `else' part when the
region stack is empty. This patch also adds crash tests which cover
other code paths which rely on getCurrentCounter() when handling
TopLevelCodeDecls.

Fixes SR-4453.
2017-03-31 16:17:34 -07:00
Vedant Kumar
609de86f94 [Coverage] Emit mappings for top-level code decls
Make sure that code in top-level decls gets decent coverage reporting.

rdar://problem/27874041
2016-09-07 11:49:22 -07:00