rust/compiler/rustc_codegen_llvm/src
Matthias Krüger 8b9ef3b996
Rollup merge of #122226 - Zalathar:zcoverage-options, r=nnethercote
coverage: Remove or migrate all unstable values of `-Cinstrument-coverage`

(This PR was substantially overhauled from its original version, which migrated all of the existing unstable values intact.)

This PR takes the three nightly-only values that are currently accepted by `-Cinstrument-coverage`, completely removes two of them (`except-unused-functions` and `except-unused-generics`), and migrates the third (`branch`) over to a newly-introduced unstable flag `-Zcoverage-options`.

I have a few motivations for wanting to do this:

- It's unclear whether anyone actually uses the `except-unused-*` values, so this serves as an opportunity to either remove them, or prompt existing users to object to their removal.
- After #117199, the stable values of `-Cinstrument-coverage` treat it as a boolean-valued flag, so having nightly-only extra values feels out-of-place.
  - Nightly-only values also require extra ad-hoc code to make sure they aren't accidentally exposed to stable users.
- The new system allows multiple different settings to be toggled independently, which isn't possible in the current single-value system.
- The new system makes it easier to introduce new behaviour behind an unstable toggle, and then gather nightly-user feedback before possibly making it the default behaviour for all users.
- The new system also gives us a convenient place to put relatively-narrow options that won't ever be the default, but that nightly users might still want access to.
- It's likely that we will eventually want to give stable users more fine-grained control over coverage instrumentation. The new flag serves as a prototype of what that stable UI might eventually look like.

The `branch` option is a placeholder that currently does nothing. It will be used by #122322 to opt into branch coverage instrumentation.

---

I see `-Zcoverage-options` as something that will exist more-or-less indefinitely, though individual sub-options might come and go as appropriate. I think there will always be some demand for nightly-only toggles, so I don't see `-Zcoverage-options` itself ever being stable, though we might eventually stabilize something similar to it.
2024-03-13 06:41:22 +01:00
..
back Add arm64ec-pc-windows-msvc target 2024-03-06 17:49:37 -08:00
coverageinfo coverage: Remove all unstable values of -Cinstrument-coverage 2024-03-13 11:14:09 +11:00
debuginfo Ensure nested allocations in statics do not get deduplicated 2024-03-12 05:53:46 +00:00
llvm Fix 32-bit overflows in LLVM composite constants 2024-03-10 17:54:55 -04:00
abi.rs use [N x i8] for byval/sret types 2024-03-05 18:54:45 -05:00
allocator.rs Add -Zuse-sync-unwind 2023-12-31 15:27:43 +08:00
asm.rs Add assertions and clarify asm-goto with noreturn 2024-02-24 19:49:16 +00:00
attributes.rs is_closure_like 2024-02-11 22:09:52 +00:00
base.rs compiler: replace cstr macro with c str literals in compiler and few other c str replacements 2023-12-03 14:54:09 +03:00
builder.rs Sink ptrtoint for RMW ops on pointers to cg_llvm 2024-03-09 10:08:53 -05:00
callee.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
common.rs Fix 32-bit overflows in LLVM composite constants 2024-03-10 17:54:55 -04:00
consts.rs Some comment nits 2024-03-12 08:51:20 +00:00
context.rs Rollup merge of #122166 - beetrees:remove-field-remapping, r=davidtwco 2024-03-11 09:29:36 -07:00
declare.rs Add unstable -Zdefault-hidden-visibility cmdline flag for rustc. 2023-12-13 21:14:23 +00:00
errors.rs Rename IntoDiagnostic as Diagnostic. 2024-03-11 09:15:09 +11:00
intrinsic.rs Rollup merge of #119365 - nbdd0121:asm-goto, r=Amanieu 2024-03-08 08:19:17 +01:00
lib.rs compiler: use addr_of! 2024-02-24 18:53:48 +03:00
llvm_util.rs Rollup merge of #121438 - coolreader18:wasm32-panic-unwind, r=cuviper 2024-03-11 09:29:34 -07:00
mono_item.rs Some comment nits 2024-03-12 08:51:20 +00:00
type_.rs Fix 32-bit overflows in LLVM composite constants 2024-03-10 17:54:55 -04:00
type_of.rs Remove the unused field_remapping field from TypeLowering 2024-03-08 03:42:47 +00:00
va_arg.rs Add arm64ec-pc-windows-msvc target 2024-03-06 17:49:37 -08:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00