rust/compiler
Guillaume Gomez 2442c9b724
Rollup merge of #114354 - Zalathar:external-counters, r=jackh726
coverage: Store BCB counter info externally, not directly in the BCB graph

When deciding how to instrument the underlying MIR for coverage, the `InstrumentCoverage` pass builds a simplified “Basic Counter Block” graph, and then allocates coverage counters/expressions to various nodes/edges in the BCB graph as necessary. Those counters/expressions are then injected into the function's MIR.

The awkward thing here is that the code for doing this needs `&mut` access to the graph, in order to associate coverage info with individual nodes, even though it isn't making any structural changes to the graph itself. That makes it harder to understand and modify the instrumentation code.

In addition, the graph alone can't hold all the information that is needed. There ends up being an extra vector of “intermediate expressions” that needs to be passed around separately anyway.

---

This PR simplifies things by instead storing all of that temporary coverage information in a number of side-tables inside `CoverageCounters`.

This makes it easier to see all of the information produced by the make-counters step, and how it is used by the inject-into-mir step.

---

Looking at the combined changes is possible, but I recommend reviewing the commits individually, because the big changes are mostly independent of each other (despite being conceptually related).
2023-08-13 21:00:46 +02:00
..
rustc inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
rustc_abi Add internal_features lint 2023-08-03 14:50:50 +02:00
rustc_arena Add internal_features lint 2023-08-03 14:50:50 +02:00
rustc_ast Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk 2023-08-08 19:23:41 +00:00
rustc_ast_lowering Rollup merge of #114667 - compiler-errors:issue-114664, r=davidtwco 2023-08-12 12:06:36 +02:00
rustc_ast_passes rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_ast_pretty Improve spans for indexing expressions 2023-08-04 13:17:39 +02:00
rustc_attr rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_baked_icu_data
rustc_borrowck Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, r=oli-obk 2023-08-08 03:30:56 +02:00
rustc_builtin_macros rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_codegen_cranelift Rollup merge of #114622 - petrochenkov:noplugin, r=oli-obk 2023-08-10 21:17:07 -07:00
rustc_codegen_gcc Rollup merge of #114382 - scottmcm:compare-bytes-intrinsic, r=cjgillot 2023-08-07 05:29:12 +02:00
rustc_codegen_llvm Auto merge of #113722 - bjorn3:allocator_shim_refactor, r=jackh726 2023-08-13 16:49:49 +00:00
rustc_codegen_ssa Remove unnecessary feature gates 2023-08-12 00:21:04 -04:00
rustc_const_eval Auto merge of #114637 - matthiaskrgr:rollup-544y8p5, r=matthiaskrgr 2023-08-08 22:00:40 +00:00
rustc_data_structures Auto merge of #114339 - ttsugriy:unsafe-utf8, r=davidtwco 2023-08-08 10:25:37 +00:00
rustc_driver Update rustix 2023-07-03 07:20:51 +00:00
rustc_driver_impl rustc: Move crate_types from Session to GlobalCtxt 2023-08-09 14:17:54 +08:00
rustc_error_codes Auto merge of #109348 - cjgillot:issue-109146, r=petrochenkov 2023-08-05 11:52:07 +00:00
rustc_error_messages Add internal_features lint 2023-08-03 14:50:50 +02:00
rustc_errors Auto merge of #114104 - oli-obk:syn2, r=compiler-errors 2023-08-04 18:46:19 +00:00
rustc_expand rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_feature feat: riscv-interrupt-{m,s} calling conventions 2023-08-08 18:09:56 -07:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Bugfix: 'can_have_side_effects()' would return 'false' for struct/enum/array/tuple literals unless *all* sub-expressions had side effects. This would easily allow side effects to slip through, and also wrongly label empty literals as having side effects. Add some tests for the last point 2023-08-10 02:26:11 +02:00
rustc_hir_analysis Only check outlives goals on impl compared to trait 2023-08-11 21:09:17 -04:00
rustc_hir_pretty Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk 2023-08-08 19:23:41 +00:00
rustc_hir_typeck Fix typo 2023-08-11 18:23:57 +05:30
rustc_incremental Add internal_features lint 2023-08-03 14:50:50 +02:00
rustc_index Add internal_features lint 2023-08-03 14:50:50 +02:00
rustc_infer Don't crash when reporting nice region errors for generic const items 2023-08-12 15:34:28 +02:00
rustc_interface rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_lexer Update lexer emoji diagnostics to Unicode 15.0 2023-07-29 08:47:21 +08:00
rustc_lint Auto merge of #114757 - Urgau:transmute-with-invalid_reference_casting, r=est31 2023-08-13 12:46:00 +00:00
rustc_lint_defs Auto merge of #114414 - cjgillot:early-unnameable-test, r=petrochenkov 2023-08-04 14:13:11 +00:00
rustc_llvm Auto merge of #114005 - Zalathar:no-cstr, r=jackh726 2023-08-10 23:06:10 +00:00
rustc_log inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
rustc_macros Add internal_features lint 2023-08-03 14:50:50 +02:00
rustc_metadata rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_middle rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_mir_build Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, r=oli-obk 2023-08-08 03:30:56 +02:00
rustc_mir_dataflow Rollup merge of #114505 - ouz-a:cleanup_mir, r=RalfJung 2023-08-06 17:26:29 +02:00
rustc_mir_transform Store BCB counters externally, not directly in the BCB graph 2023-08-13 12:18:06 +10:00
rustc_monomorphize Store the laziness of type aliases in the DefKind 2023-08-07 15:54:31 +02:00
rustc_parse inlined kind 2023-08-08 10:59:15 +08:00
rustc_parse_format Fix unit tests 2023-07-19 16:37:09 +00:00
rustc_passes Auto merge of #114723 - petrochenkov:noplugin2, r=davidtwco 2023-08-13 10:59:36 +00:00
rustc_plugin_impl
rustc_privacy Store the laziness of type aliases in the DefKind 2023-08-07 15:54:31 +02:00
rustc_query_impl Add internal_features lint 2023-08-03 14:50:50 +02:00
rustc_query_system Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, r=oli-obk 2023-08-08 03:30:56 +02:00
rustc_resolve rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_serialize Upgrade to indexmap 2.0.0 2023-07-03 13:51:54 -07:00
rustc_session rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
rustc_smir Rollup merge of #114703 - ouz-a:smir_allocation, r=oli-obk 2023-08-12 12:06:37 +02:00
rustc_span feat: riscv-interrupt-{m,s} calling conventions 2023-08-08 18:09:56 -07:00
rustc_symbol_mangling Auto merge of #114672 - lenawanel:master, r=compiler-errors 2023-08-11 09:30:41 +00:00
rustc_target Auto merge of #114614 - RalfJung:offset-of-sanity, r=cjgillot 2023-08-10 07:54:05 +00:00
rustc_trait_selection Auto merge of #114457 - lcnr:trait_ref_is_knowable-normalize, r=compiler-errors 2023-08-13 05:18:27 +00:00
rustc_traits refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
rustc_transmute Don't attempt to compute layout of type referencing error 2023-07-27 18:24:08 +00:00
rustc_ty_utils Rollup merge of #114670 - compiler-errors:issue-114660, r=cjgillot 2023-08-09 23:00:00 +02:00
rustc_type_ir Comment nits 2023-08-10 23:22:03 +00:00