diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-11-22 17:52:02 +1100 | 
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-11-26 12:05:57 +1100 | 
| commit | 3d12160dfcb4d95cd3f1eaa23071fb9b4e3d69ab (patch) | |
| tree | 2b5fc38b876c42d159fe366a36c53bc97038b461 /compiler/rustc_mir_dataflow/src/storage.rs | |
| parent | 71789427a3b420fc4e729a748e1bf22d0a444bfa (diff) | |
| download | rust-3d12160dfcb4d95cd3f1eaa23071fb9b4e3d69ab.tar.gz rust-3d12160dfcb4d95cd3f1eaa23071fb9b4e3d69ab.zip | |
Move `always_storage_live_locals`.
It's very closely related to `MaybeStorageLive` and `MaybeStorageDead`. It's weird that it's currently in a different module.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/storage.rs')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/storage.rs | 20 | 
1 files changed, 0 insertions, 20 deletions
| diff --git a/compiler/rustc_mir_dataflow/src/storage.rs b/compiler/rustc_mir_dataflow/src/storage.rs deleted file mode 100644 index e5a0e1d312e..00000000000 --- a/compiler/rustc_mir_dataflow/src/storage.rs +++ /dev/null @@ -1,20 +0,0 @@ -use rustc_index::bit_set::BitSet; -use rustc_middle::mir::{self, Local}; - -/// The set of locals in a MIR body that do not have `StorageLive`/`StorageDead` annotations. -/// -/// These locals have fixed storage for the duration of the body. -pub fn always_storage_live_locals(body: &mir::Body<'_>) -> BitSet<Local> { - let mut always_live_locals = BitSet::new_filled(body.local_decls.len()); - - for block in &*body.basic_blocks { - for statement in &block.statements { - use mir::StatementKind::{StorageDead, StorageLive}; - if let StorageLive(l) | StorageDead(l) = statement.kind { - always_live_locals.remove(l); - } - } - } - - always_live_locals -} | 
