rust/compiler/rustc_abi/src
Matthias Krüger 613bccc4ca
Rollup merge of #124555 - Zalathar:init-coverage, r=nnethercote
coverage: Clean up creation of MC/DC condition bitmaps

This PR improves the code for creating and initializing [MC/DC](https://en.wikipedia.org/wiki/Modified_condition/decision_coverage) condition bitmap variables, as introduced by #123409 and modified by #124255.

- The condition bitmap variables are now created eagerly at the start of per-function codegen, via a new `init_coverage` method in `CoverageInfoBuilderMethods`. This avoids having to retroactively create the bitmaps while doing codegen for an individual coverage statement.
- As a result, we can now create and initialize those bitmaps using existing safe APIs, instead of having to perform our own unsafe call to `llvm::LLVMBuildAlloca`.
- This PR also tweaks the way we count the number of condition bitmaps needed, by tracking the total number of bitmaps needed (max depth + 1), instead of only tracking the maximum depth. This reduces the potential for subtle off-by-one confusion.
2024-05-03 20:33:46 +02:00
..
layout.rs Rename inihibit_union_abi_opt() to inihibits_union_abi_opt() 2024-04-28 13:09:36 +05:30
lib.rs Rollup merge of #124555 - Zalathar:init-coverage, r=nnethercote 2024-05-03 20:33:46 +02:00
tests.rs coverage: Set up MC/DC bitmaps without additional unsafe code 2024-05-01 09:55:22 +10:00