about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorWesley Wiser <wesleywiser@microsoft.com>2021-12-20 16:36:56 -0500
committerWesley Wiser <wesleywiser@microsoft.com>2021-12-20 17:08:29 -0500
commitef57f249a2244634a5c98d431d3bbfd715bd9c89 (patch)
treed453ea22df1a9d58693ae18e76ba4fe28cc6cc12 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent341d65d975453af9e548f1f668256604dc1f156a (diff)
downloadrust-ef57f249a2244634a5c98d431d3bbfd715bd9c89.tar.gz
rust-ef57f249a2244634a5c98d431d3bbfd715bd9c89.zip
[code coverage] Fix missing dead code in modules that are never called
The issue here is that the logic used to determine which CGU to put the
dead function stubs in doesn't handle cases where a module is never
assigned to a CGU.

The partitioning logic also caused issues in #85461 where inline
functions were duplicated into multiple CGUs resulting in duplicate
symbols.

This commit fixes the issue by removing the complex logic used to assign
dead code stubs to CGUs and replaces it with a much simplier model: we
pick one CGU to hold all the dead code stubs. We pick a CGU which has
exported items which increases the likelihood the linker won't throw
away our dead functions and we pick the smallest to minimize the impact
on compilation times for crates with very large CGUs.

Fixes #86177
Fixes #85718
Fixes #79622
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions