about summary refs log tree commit diff
path: root/src/librustc_data_structures/bitslice.rs
AgeCommit message (Collapse)AuthorLines
2018-09-13Remove bitslice.rs.Nicholas Nethercote-146/+0
This requires the following changes. - It moves parts of bitslice.rs into bitvec.rs: `bitwise()`, `BitwiseOperator`, `bits_to_string()`. - It changes `IdxSet` to just be a wrapper around `BitArray`. - It changes `BitArray` and `BitVec` to use `usize` words instead of `u128` words. (`BitSlice` and `IdxSet` already use `usize`.) Local profiling showed `usize` was better. - It moves some operations from `IdxSet` into `BitArray`: `new_filled()`, `clear()`, `set_up_to()`, `trim_to()` (renamed `clear_above()`), `words()` and `words_mut()`, `encode()` and `decode(). The `IdxSet` operations now just call the `BitArray` operations. - It replaces `BitArray`'s iterator implementation with `IdxSet`'s, because the latter is more concise. It also removes the buggy `size_hint` function from `BitArray`'s iterator, which counted the number of *words* rather than the number of *bits*. `IdxSet`'s iterator is now just a thin wrapper around `BitArray`'s iterator. - It moves some unit tests from `indexed_set.rs` to `bitvec.rs`.
2018-08-09A few cleanups for rustc_data_structuresljedrz-2/+3
2018-07-24Simplify a few functions in rustc_data_structuresljedrz-2/+1
2018-07-13Fix bitslice printing.Nicholas Nethercote-11/+5
In multiple ways: - Two calls to `bits_to_string()` passed in byte lengths rather than bit lengths, which meant only 1/8th of the `BitSlice` was printed. - `bit_str`'s purpose is entirely mysterious. I removed it and changed its callers to print the indices in the obvious way. - `bits_to_string`'s inner loop was totally wrong, such that it printed entirely bogus results. - `bits_to_string` now also adds a '|' between words, which makes the output easier to read, e.g.: `[ff-ff-ff-ff-ff-ff-ff-ff|ff-ff-ff-ff-ff-ff-ff-07]`.
2018-07-13Make BitSlice's `Word` properly generic.Nicholas Nethercote-7/+7
Currently `Word` is `usize`, and there are various places in the code that assume this. This patch mostly just changes `usize` occurrences to `Word`. Most of the changes were found as compile errors when I changed `Word` to a type other than `usize`, but there was one non-obvious case in librustc_mir/dataflow/mod.rs that caused bounds check failures before I fixed it.
2018-02-21rustc_data_structures: add missing #[inline].Eduard-Mihai Burtescu-0/+3
2017-09-13Analyse storage liveness and preserve it during generator transformationJohn Kåre Alsaker-0/+5
2017-07-31rustc: Inline bitwise modification operatorsAlex Crichton-0/+2
These need to be inlined across crates to avoid showing up as one-instruction functions in profiles! In the benchmark from #43578 this decreased the translation item collection step from 30s to 23s, and looks like it also allowed vectorization elsewhere of the operations!
2016-10-10Move IdxSetBuf and BitSlice to rustc_data_structuresWesley Wiser-0/+142
Resolves a FIXME