]> git.lizzy.rs Git - rust.git/commit
Fix unreachable coverage generation for inlined functions
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Sun, 3 Jul 2022 00:00:00 +0000 (00:00 +0000)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Fri, 8 Jul 2022 07:23:35 +0000 (09:23 +0200)
commit62ab4b61609e6f1329c3f386e545412e8c7e58d6
treeb2626b00ad57a7e75fe61b89609a3d04ec04054f
parentfadae872fabd317020eeefbb118d8e07e5e43994
Fix unreachable coverage generation for inlined functions

To generate a function coverage we need at least one coverage counter,
so a coverage from unreachable blocks is retained only when some live
counters remain.

The previous implementation incorrectly retained unreachable coverage,
because it didn't account for the fact that those live counters can
belong to another function due to inlining.
compiler/rustc_mir_transform/src/simplify.rs
compiler/rustc_monomorphize/src/partitioning/mod.rs
src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.inline-dead.txt [new file with mode: 0644]
src/test/run-make-fulldeps/coverage/inline-dead.rs [new file with mode: 0644]