rustc_mir_transform::coverage::query

Function identify_zero_expressions

Source
fn identify_zero_expressions(
    fn_cov_info: &FunctionCoverageInfo,
    counters_seen: &BitSet<CounterId>,
    expressions_seen: &BitSet<ExpressionId>,
) -> BitSet<ExpressionId>
Expand description

Identify expressions that will always have a value of zero, and note their IDs in a BitSet. Mappings that refer to a zero expression can instead become mappings to a constant zero value.

This function mainly exists to preserve the simplifications that were already being performed by the Rust-side expression renumbering, so that the resulting coverage mappings don’t get worse.