diff options
| author | Dorian Péron <peron@adacore.com> | 2024-04-10 10:13:04 +0000 |
|---|---|---|
| committer | Dorian Péron <peron@adacore.com> | 2024-04-29 09:13:40 +0000 |
| commit | 60ca9b6e29975ab36e5460d761d99681bef0f130 (patch) | |
| tree | 7845b93e279e3d957f4931f3a5e4ab0c80c793d6 /compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs | |
| parent | ae8c023983247044838a1a8b5f6fb5dd606fa68d (diff) | |
| download | rust-60ca9b6e29975ab36e5460d761d99681bef0f130.tar.gz rust-60ca9b6e29975ab36e5460d761d99681bef0f130.zip | |
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
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs index eb1071448ce..679c6e1a2ff 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs @@ -206,7 +206,8 @@ fn ensure_mcdc_parameters<'ll, 'tcx>( let fn_name = bx.get_pgo_func_name_var(instance); let hash = bx.const_u64(function_coverage_info.function_source_hash); let bitmap_bytes = bx.const_u32(function_coverage_info.mcdc_bitmap_bytes); - let cond_bitmap = bx.mcdc_parameters(fn_name, hash, bitmap_bytes, 1_u32); + let max_decision_depth = function_coverage_info.mcdc_max_decision_depth; + let cond_bitmap = bx.mcdc_parameters(fn_name, hash, bitmap_bytes, max_decision_depth as u32); bx.coverage_context() .expect("already checked above") .mcdc_condition_bitmap_map |
