diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-01-11 18:13:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-11 18:13:47 +0100 |
| commit | 0bb0f0412fcf970dd8997281a4e30b4059ca6e5d (patch) | |
| tree | 2ad83f26990f710592a8bbcb7dce7fb1a2f31459 /compiler/rustc_mir_transform/src/coverage/graph.rs | |
| parent | 2bcd5cf1ecf684511d0a842ce5495a1595e0ce95 (diff) | |
| parent | 95cbb3b96425fe173a9d868b72caf9efc4d1615f (diff) | |
| download | rust-0bb0f0412fcf970dd8997281a4e30b4059ca6e5d.tar.gz rust-0bb0f0412fcf970dd8997281a4e30b4059ca6e5d.zip | |
Rollup merge of #135205 - lqd:bitsets, r=Mark-Simulacrum
Rename `BitSet` to `DenseBitSet` r? `@Mark-Simulacrum` as you requested this in https://github.com/rust-lang/rust/pull/134438#discussion_r1890659739 after such a confusion. This PR renames `BitSet` to `DenseBitSet` to make it less obvious as the go-to solution for bitmap needs, as well as make its representation (and positives/negatives) clearer. It also expands the comments there to hopefully make it clearer when it's not a good fit, with some alternative bitsets types. (This migrates the subtrees cg_gcc and clippy to use the new name in separate commits, for easier review by their respective owners, but they can obvs be squashed)
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/graph.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coverage/graph.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/graph.rs b/compiler/rustc_mir_transform/src/coverage/graph.rs index ad6774fccd6..3fa8b063fa7 100644 --- a/compiler/rustc_mir_transform/src/coverage/graph.rs +++ b/compiler/rustc_mir_transform/src/coverage/graph.rs @@ -8,7 +8,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::graph::dominators::Dominators; use rustc_data_structures::graph::{self, DirectedGraph, StartNode}; use rustc_index::IndexVec; -use rustc_index::bit_set::BitSet; +use rustc_index::bit_set::DenseBitSet; use rustc_middle::mir::{self, BasicBlock, Terminator, TerminatorKind}; use tracing::debug; @@ -27,7 +27,7 @@ pub(crate) struct CoverageGraph { /// their relative order is consistent but arbitrary. dominator_order_rank: IndexVec<BasicCoverageBlock, u32>, /// A loop header is a node that dominates one or more of its predecessors. - is_loop_header: BitSet<BasicCoverageBlock>, + is_loop_header: DenseBitSet<BasicCoverageBlock>, /// For each node, the loop header node of its nearest enclosing loop. /// This forms a linked list that can be traversed to find all enclosing loops. enclosing_loop_header: IndexVec<BasicCoverageBlock, Option<BasicCoverageBlock>>, @@ -72,7 +72,7 @@ impl CoverageGraph { predecessors, dominators: None, dominator_order_rank: IndexVec::from_elem_n(0, num_nodes), - is_loop_header: BitSet::new_empty(num_nodes), + is_loop_header: DenseBitSet::new_empty(num_nodes), enclosing_loop_header: IndexVec::from_elem_n(None, num_nodes), }; assert_eq!(num_nodes, this.num_nodes()); |
