From 3d12160dfcb4d95cd3f1eaa23071fb9b4e3d69ab Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 22 Nov 2024 17:52:02 +1100 Subject: 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. --- compiler/rustc_mir_dataflow/src/storage.rs | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 compiler/rustc_mir_dataflow/src/storage.rs (limited to 'compiler/rustc_mir_dataflow/src/storage.rs') 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 { - 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 -} -- cgit 1.4.1-3-g733a5