Skip to content

Commit

Permalink
Improve MaybeStorageLive::initialize_start_block.
Browse files Browse the repository at this point in the history
We can union the two sets the easy way. This removes the need for the
domain size check, because `union` does that same check itself.
  • Loading branch information
nnethercote committed Nov 26, 2024
1 parent 481b5fa commit 7178942
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ impl<'a, 'tcx> Analysis<'tcx> for MaybeStorageLive<'a> {
}

fn initialize_start_block(&self, body: &Body<'tcx>, on_entry: &mut Self::Domain) {
assert_eq!(body.local_decls.len(), self.always_live_locals.domain_size());
for local in self.always_live_locals.iter() {
on_entry.insert(local);
}
on_entry.union(&*self.always_live_locals);

for arg in body.args_iter() {
on_entry.insert(arg);
Expand Down

0 comments on commit 7178942

Please sign in to comment.