Skip to content

Commit 21cd1fe

Browse files
committedFeb 29, 2020
Process RequiresStorage results in pre-order
Reverse post-order requires an allocation.
1 parent 75d256f commit 21cd1fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/librustc_mir/transform/generator.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,9 @@ fn compute_storage_conflicts(
619619
local_conflicts: BitMatrix::from_row_n(&ineligible_locals, body.local_decls.len()),
620620
};
621621

622-
// FIXME: Do we need to do this in RPO?
623-
requires_storage.visit_in_rpo_with(body, &mut visitor);
622+
// Visit only reachable basic blocks. The exact order is not important.
623+
let reachable_blocks = traversal::preorder(body).map(|(bb, _)| bb);
624+
requires_storage.visit_with(body, reachable_blocks, &mut visitor);
624625

625626
let local_conflicts = visitor.local_conflicts;
626627

0 commit comments

Comments
 (0)