Improve MaybeStorageLive::initialize_start_block.

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.
This commit is contained in:
Nicholas Nethercote 2024-11-22 16:30:35 +11:00
parent 481b5fadd7
commit 71789427a3

View File

@ -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);