Commit Graph

3 Commits

Author SHA1 Message Date
Hamish Knight
3325296401 [test] Enable some profiler tests on non-macOS 2024-08-04 10:45:29 +01:00
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
cc465937a2 [IRGen] Emit name data for unused coverage counters
Previously, if all the coverage counters for a
given SIL function were optimized out, we would
have dropped the coverage map on the floor,
leading to inaccurate coverage reports in `-O`.
However LLVM allows us to emit the name data for
the coverage maps separately by defining an
`__llvm_coverage_names` global with the name data,
which is picked up by its instrumentation lowering
pass. Use this to continue to emit coverage maps
for functions that do not get emitted.

rdar://99813754
2022-09-16 15:47:16 +01:00