coverage: Detach #[coverage(..)] from codegen attribute handling

This commit is contained in:
Zalathar 2024-06-20 10:49:40 +10:00
parent fda509e817
commit 457fda1701
4 changed files with 35 additions and 22 deletions

View file

@ -572,6 +572,14 @@ rustc_queries! {
separate_provide_extern
}
/// Checks for `#[coverage(off)]` or `#[coverage(on)]`.
///
/// Returns `false` if `#[coverage(off)]` was found, or `true` if
/// either `#[coverage(on)]` or no coverage attribute was found.
query coverage_attr_on(key: LocalDefId) -> bool {
desc { |tcx| "checking for `#[coverage(..)]` on `{}`", tcx.def_path_str(key) }
}
/// Summarizes coverage IDs inserted by the `InstrumentCoverage` MIR pass
/// (for compiler option `-Cinstrument-coverage`), after MIR optimizations
/// have had a chance to potentially remove some of them.