rust/compiler
Wesley Wiser ef57f249a2 [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
2021-12-20 17:08:29 -05:00
..
rustc Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_apfloat Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_arena Add some comments. 2021-11-19 07:52:59 +11:00
rustc_ast Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_ast_lowering Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_ast_passes Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_ast_pretty Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
rustc_attr Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
rustc_borrowck Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_builtin_macros Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_codegen_cranelift Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_codegen_gcc Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_codegen_llvm [code coverage] Fix missing dead code in modules that are never called 2021-12-20 17:08:29 -05:00
rustc_codegen_ssa Rollup merge of #92029 - nikic:section-flags-fix, r=davidtwco 2021-12-19 17:38:35 +01:00
rustc_const_eval Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_data_structures Auto merge of #91837 - Kobzol:stable-hash-map-avoid-sort, r=the8472 2021-12-18 21:23:37 +00:00
rustc_driver fix clippy::single_char_pattern perf findings 2021-12-14 12:40:28 +01:00
rustc_error_codes Clarify and tidy up explanation of E0038 2021-11-30 09:25:17 -08:00
rustc_errors Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_expand Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_feature Stabilize destructuring_assignment 2021-12-14 22:38:51 -05:00
rustc_fs_util Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_graphviz fix clippy::single_char_pattern perf findings 2021-12-14 12:40:28 +01:00
rustc_hir Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_hir_pretty Auto merge of #89841 - cormacrelf:let-else-typed, r=nagisa 2021-12-17 22:12:34 +00:00
rustc_incremental Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_index Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_infer Eliminate ObligationCauseData. 2021-12-20 09:29:20 +11:00
rustc_interface Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_lexer Auto merge of #91393 - Julian-Wollersberger:lexer_optimization, r=petrochenkov 2021-12-03 13:20:14 +00:00
rustc_lint Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_lint_defs Rollup merge of #89090 - cjgillot:bare-dyn, r=jackh726 2021-12-18 08:16:26 +01:00
rustc_llvm Auto merge of #91284 - t6:freebsd-riscv64, r=Amanieu 2021-12-06 03:51:05 +00:00
rustc_macros Remove in_band_lifetimes from rustc_middle 2021-12-15 19:50:43 -05:00
rustc_metadata Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_middle [code coverage] Fix missing dead code in modules that are never called 2021-12-20 17:08:29 -05:00
rustc_mir_build Rollup merge of #91791 - terrarier2111:fix-float-ice, r=nagisa 2021-12-19 17:38:33 +01:00
rustc_mir_dataflow Remove in_band_lifetimes from rustc_mir_dataflow 2021-12-16 14:29:43 -05:00
rustc_mir_transform [code coverage] Fix missing dead code in modules that are never called 2021-12-20 17:08:29 -05:00
rustc_monomorphize [code coverage] Fix missing dead code in modules that are never called 2021-12-20 17:08:29 -05:00
rustc_parse Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_parse_format Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_passes Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_plugin_impl replace dynamic library module with libloading 2021-12-06 12:03:47 -05:00
rustc_privacy Remove in_band_lifetimes from rustc_privacy 2021-12-14 12:38:06 -05:00
rustc_query_impl Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_query_system Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_resolve Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_save_analysis Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_serialize Auto merge of #91626 - klensy:json-less-alloc, r=petrochenkov 2021-12-13 07:30:38 +00:00
rustc_session Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgr 2021-12-19 12:36:56 +00:00
rustc_span Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_symbol_mangling Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
rustc_target Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgr 2021-12-19 12:36:56 +00:00
rustc_trait_selection Auto merge of #92041 - Aaron1011:remove-speculative-evaluation, r=jackh726 2021-12-20 07:30:16 +00:00
rustc_traits get rid of normalize_generic_arg... queries 2021-12-13 23:05:25 +01:00
rustc_ty_utils Use a const ParamEnv when in default_method_body_is_const 2021-12-17 20:42:48 +08:00
rustc_type_ir Fix HashStable implementation on InferTy 2021-12-13 20:36:17 -08:00
rustc_typeck Eliminate ObligationCauseData. 2021-12-20 09:29:20 +11:00