diff options
| author | Mikhail Modin <mikhailm1@gmail.com> | 2017-11-10 14:11:25 +0300 |
|---|---|---|
| committer | Mikhail Modin <mikhailm1@gmail.com> | 2017-11-15 11:21:05 +0300 |
| commit | 830d65c1ffa2f19ada218d8a95b62042411b68a7 (patch) | |
| tree | f129fb45a983a806efee7d76f05bdf23d02be0ea /src/librustc_mir/dataflow/impls | |
| parent | f93a4928c2168bcc475b4fe77ba9f9e5494ffe1c (diff) | |
| download | rust-830d65c1ffa2f19ada218d8a95b62042411b68a7.tar.gz rust-830d65c1ffa2f19ada218d8a95b62042411b68a7.zip | |
add `StorageDead` handling
Diffstat (limited to 'src/librustc_mir/dataflow/impls')
| -rw-r--r-- | src/librustc_mir/dataflow/impls/mod.rs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/librustc_mir/dataflow/impls/mod.rs b/src/librustc_mir/dataflow/impls/mod.rs index dad96dc3a6f..524f8ffed83 100644 --- a/src/librustc_mir/dataflow/impls/mod.rs +++ b/src/librustc_mir/dataflow/impls/mod.rs @@ -456,14 +456,21 @@ impl<'a, 'gcx, 'tcx> BitDenotation for MovingOutStatements<'a, 'gcx, 'tcx> { let path_map = &move_data.path_map; let rev_lookup = &move_data.rev_lookup; - debug!("stmt {:?} at loc {:?} moves out of move_indexes {:?}", - stmt, location, &loc_map[location]); - for move_index in &loc_map[location] { - // Every path deinitialized by a *particular move* - // has corresponding bit, "gen'ed" (i.e. set) - // here, in dataflow vector - zero_to_one(sets.gen_set.words_mut(), *move_index); + match stmt.kind { + // skip move out for StorageDead + mir::StatementKind::StorageDead(_) => {} + _ => { + debug!("stmt {:?} at loc {:?} moves out of move_indexes {:?}", + stmt, location, &loc_map[location]); + for move_index in &loc_map[location] { + // Every path deinitialized by a *particular move* + // has corresponding bit, "gen'ed" (i.e. set) + // here, in dataflow vector + zero_to_one(sets.gen_set.words_mut(), *move_index); + } + } } + let bits_per_block = self.bits_per_block(); match stmt.kind { mir::StatementKind::SetDiscriminant { .. } => { |
