Commit Graph

5 Commits

Author SHA1 Message Date
Hamish Knight
c3b055a9a8 [Profiler] Improve if statement coverage
Fix counters for regions following `else if`s, fix
the counters for `else if` conditions, and fix
handling of `break` statements. Also while here,
clean up the handling of branch exit regions such
that we don't generate multiple overlapping
regions for each branch, but a single region at
the end of the entire `if` statement that accounts
for all exiting control flow.

rdar://104078910
rdar://104079242
2023-12-04 11:09:01 +00:00
Hamish Knight
b66665f6d8 [test] Add an additional coverage test 2023-11-30 12:37:08 +00:00
Hamish Knight
322ce4e3f4 [Profiler] Fix handling of property wrapper backing inits
Previously we were walking into the
PropertyWrapperValuePlaceholderExpr when generating
coverage for a property wrapper backing initializer.
This meant that we were duplicating the coverage of
the initializer expression, and it could cause
crashes if a refined counter was introduced within
the top-most expression region, such as with a
throwing expression in a `try!`.

rdar://118939162
2023-11-29 22:58:29 +00:00
Hamish Knight
bd18c37b82 [Profiler] Adopt SILDeclRef::hasUserWrittenCode
This replaces some of the existing checks, and
ensures that we don't emit coverage maps for
property wrapper backing initializers that don't
contain user code.

rdar://99931619
2022-09-29 10:08:15 +01:00
Hamish Knight
9f93bc8dcd [Profiler] Emit increment for property wrapper backing initializers
Previously we were creating a SILProfiler for
such functions, but weren't actually emitting the
increment, leading to missed coverage.

Part of the fix for rdar://99931619
2022-09-26 12:18:44 +01:00