1
Fork 0

coverage: Rename MC/DC conditions_num to num_conditions

This value represents a quantity of conditions, not an ID, so the new spelling
is more appropriate.
This commit is contained in:
Zalathar 2024-05-30 13:16:07 +10:00
parent 23ea77b8ed
commit c671eaaaff
10 changed files with 34 additions and 33 deletions

View file

@ -48,7 +48,7 @@ pub(super) struct MCDCDecision {
pub(super) span: Span,
pub(super) end_bcbs: BTreeSet<BasicCoverageBlock>,
pub(super) bitmap_idx: u32,
pub(super) conditions_num: u16,
pub(super) num_conditions: u16,
pub(super) decision_depth: u16,
}
@ -268,13 +268,13 @@ pub(super) fn extract_mcdc_mappings(
// the bitmap, rounded up to a whole number of bytes.
// The decision's "bitmap index" points to its first byte in the bitmap.
let bitmap_idx = *mcdc_bitmap_bytes;
*mcdc_bitmap_bytes += (1_u32 << decision.conditions_num).div_ceil(8);
*mcdc_bitmap_bytes += (1_u32 << decision.num_conditions).div_ceil(8);
Some(MCDCDecision {
span,
end_bcbs,
bitmap_idx,
conditions_num: decision.conditions_num as u16,
num_conditions: decision.num_conditions as u16,
decision_depth: decision.decision_depth,
})
},

View file

@ -195,9 +195,9 @@ fn create_mappings<'tcx>(
));
mappings.extend(mcdc_decisions.iter().filter_map(
|&mappings::MCDCDecision { span, bitmap_idx, conditions_num, .. }| {
|&mappings::MCDCDecision { span, bitmap_idx, num_conditions, .. }| {
let code_region = region_for_span(span)?;
let kind = MappingKind::MCDCDecision(DecisionInfo { bitmap_idx, conditions_num });
let kind = MappingKind::MCDCDecision(DecisionInfo { bitmap_idx, num_conditions });
Some(Mapping { kind, code_region })
},
));
@ -269,7 +269,7 @@ fn inject_mcdc_statements<'tcx>(
span: _,
ref end_bcbs,
bitmap_idx,
conditions_num: _,
num_conditions: _,
decision_depth,
} in &extracted_mappings.mcdc_decisions
{