mcdc-coverage: Get decision_depth from THIR lowering

Use decision context stack to handle nested decisions:
- Introduce MCDCDecisionCtx
- Use a stack of MCDCDecisionCtx to handle nested decisions
This commit is contained in:
Dorian Péron 2024-04-10 10:13:04 +00:00
parent ae8c023983
commit 60ca9b6e29
5 changed files with 82 additions and 18 deletions

View file

@ -275,6 +275,9 @@ pub struct FunctionCoverageInfo {
pub mcdc_bitmap_bytes: u32,
pub expressions: IndexVec<ExpressionId, Expression>,
pub mappings: Vec<Mapping>,
/// The depth of the deepest decision is used to know how many
/// temp condbitmaps should be allocated for the function.
pub mcdc_max_decision_depth: u16,
}
/// Branch information recorded during THIR-to-MIR lowering, and stored in MIR.