You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #124571 - Zalathar:num-conditions, r=compiler-errors
coverage: Clean up `mcdc_bitmap_bytes` and `conditions_num`
This is a combination of two mostly-separate MC/DC coverage cleanups that would conflict with each other, plus some extra tests that appeared along the way.
The first change is to stop recomputing `mcdc_bitmap_bytes` in the query that produces `CoverageIdsInfo`. This appears to have been inspired by how we were already computing `max_counter_id`, but there's an important difference between the two cases.
When computing `max_counter_id`, the highest counter ID seen might be less than the highest ID used during MIR instrumentation, because some counter-increment statements might have been removed by MIR optimizations.
But for the recomputation used for `mcdc_bitmap_bytes`, that's impossible, because both computations are based on pre-optimization info. So there's no need to recompute the exact same value, when it can't have changed
---
The second change is to rename `conditions_num` to `num_conditions`, to make it clearer that this refers to a *number of conditions*, not some kind of ID number.
Because this change touched the compiler warning for a decision containing too many conditions, I also noticed that we didn't have any tests for that warning.
(It now seems a bit strange to me that this is a compiler warning, not a lint, because it can't be silenced or denied by the usual mechanisms for controlling lints. But I consider that change to be beyond the scope of this PR.)
.note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
98
98
.label = dereference of raw pointer
99
99
100
-
mir_build_exceeds_mcdc_condition_num_limit = Conditions number of the decision ({$conditions_num}) exceeds limit ({$max_conditions_num}). MCDC analysis will not count this expression.
100
+
mir_build_exceeds_mcdc_condition_limit =
101
+
number of conditions in decision ({$num_conditions}) exceeds limit ({$limit})
102
+
.note = this decision will not be instrumented for MC/DC coverage
101
103
102
104
mir_build_extern_static_requires_unsafe =
103
105
use of extern static is unsafe and requires unsafe block
0 commit comments