rust/compiler/rustc_mir_transform/src
Matthias Krüger 2fe9a32ed2
Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser
Stabilize `-Z instrument-coverage` as `-C instrument-coverage`

(Tracking issue for `instrument-coverage`: https://github.com/rust-lang/rust/issues/79121)

This PR stabilizes support for instrumentation-based code coverage, previously provided via the `-Z instrument-coverage` option. (Continue supporting `-Z instrument-coverage` for compatibility for now, but show a deprecation warning for it.)

Many, many people have tested this support, and there are numerous reports of it working as expected.

Move the documentation from the unstable book to stable rustc documentation. Update uses and documentation to use the `-C` option.

Addressing questions raised in the tracking issue:

> If/when stabilized, will the compiler flag be updated to -C instrument-coverage? (If so, the -Z variant could also be supported for some time, to ease migrations for existing users and scripts.)

This stabilization PR updates the option to `-C` and keeps the `-Z` variant to ease migration.

> The Rust coverage implementation depends on (and automatically turns on) -Z symbol-mangling-version=v0. Will stabilizing this feature depend on stabilizing v0 symbol-mangling first? If so, what is the current status and timeline?

This stabilization PR depends on https://github.com/rust-lang/rust/pull/90128 , which stabilizes `-C symbol-mangling-version=v0` (but does not change the default symbol-mangling-version).

> The Rust coverage implementation implements the latest version of LLVM's Coverage Mapping Format (version 4), which forces a dependency on LLVM 11 or later. A compiler error is generated if attempting to compile with coverage, and using an older version of LLVM.

Given that LLVM 13 has now been released, requiring LLVM 11 for coverage support seems like a reasonable requirement. If people don't have at least LLVM 11, nothing else breaks; they just can't use coverage support. Given that coverage support currently requires a nightly compiler and LLVM 11 or newer, allowing it on a stable compiler built with LLVM 11 or newer seems like an improvement.

The [tracking issue](https://github.com/rust-lang/rust/issues/79121) and the [issue label A-code-coverage](https://github.com/rust-lang/rust/labels/A-code-coverage) link to a few open issues related to `instrument-coverage`, but none of them seem like showstoppers. All of them seem like improvements and refinements we can make after stabilization.

The original `-Z instrument-coverage` support went through a compiler-team MCP at https://github.com/rust-lang/compiler-team/issues/278 . Based on that, `@pnkfelix` suggested that this needed a stabilization PR and a compiler-team FCP.
2022-02-04 18:42:13 +01:00
..
coverage Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
inline initial revert 2022-01-15 01:16:55 +00:00
abort_unwinding_calls.rs Treat drop_in_place as nounwind with -Z panic-in-drop=abort 2021-09-10 14:18:15 +01:00
add_call_guards.rs Move rustc_mir::transform to rustc_mir_transform. 2021-09-07 00:43:14 +02:00
add_moves_for_packed_drops.rs Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
add_retag.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
check_const_item_mutation.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
check_packed_ref.rs give more help in the unaligned_references lint 2021-12-09 16:48:51 -05:00
check_unsafety.rs Auto merge of #90986 - camsteffen:nested-filter, r=cjgillot 2022-01-17 14:50:50 +00:00
cleanup_post_borrowck.rs Move rustc_mir::transform to rustc_mir_transform. 2021-09-07 00:43:14 +02:00
const_debuginfo.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
const_goto.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
const_prop.rs Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieu 2022-01-17 09:40:29 +00:00
deaggregator.rs Move rustc_mir::transform to rustc_mir_transform. 2021-09-07 00:43:14 +02:00
deduplicate_blocks.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
dest_prop.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
dump_mir.rs Inline on_mir_pass and add inline to dump_mir 2021-10-14 15:26:59 -05:00
early_otherwise_branch.rs Correct the unsoundness in the EarlyOtherwiseBranch mir opt 2021-12-14 05:58:05 -05:00
elaborate_drops.rs Delay remaining span_bugs in drop elaboration 2021-12-22 21:32:06 +01:00
function_item_references.rs remove TyS::same_type 2022-02-01 11:21:26 +01:00
generator.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
inline.rs Remove PartialOrd and Ord from LocalDefId 2021-12-22 10:50:57 -06:00
instcombine.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
lib.rs add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
lower_intrinsics.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
lower_slice_len.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
marker.rs Add pass for simple phase change 2021-12-02 17:31:38 -08:00
match_branches.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
multiple_return_terminators.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
normalize_array_len.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
nrvo.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
pass_manager.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
remove_false_edges.rs Separate RemoveFalseEdges from SimplifyBranches 2021-11-30 17:14:48 -08:00
remove_noop_landing_pads.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
remove_storage_markers.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
remove_uninit_drops.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
remove_unneeded_drops.rs Add rationale for RemoveUnneededDrops 2021-11-30 17:25:30 -08:00
remove_zsts.rs Update passes with new interface 2021-12-02 17:31:38 -08:00
required_consts.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
reveal_all.rs use try_normalize_erasing_regions in RevealAllVisitor 2021-12-13 23:13:24 +01:00
separate_const_switch.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
shim.rs initial revert 2022-01-15 01:16:55 +00:00
simplify_branches.rs Auto merge of #91279 - scottmcm:small-refactor, r=nagisa 2021-12-06 13:04:18 +00:00
simplify_comparison_integral.rs Remove in_band_lifetimes from rustc_mir_transform 2021-12-07 21:04:40 -08:00
simplify_try.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
simplify.rs Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
uninhabited_enum_branching.rs Rollup merge of #89764 - tmiasko:uninhabited-enums, r=wesleywiser 2022-01-20 17:10:31 +01:00
unreachable_prop.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00