Skip to content

Commit

Permalink
Process RequiresStorage results in pre-order
Browse files Browse the repository at this point in the history
Reverse post-order requires an allocation.
  • Loading branch information
ecstatic-morse committed Feb 29, 2020
1 parent 75d256f commit 21cd1fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_mir/transform/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,9 @@ fn compute_storage_conflicts(
local_conflicts: BitMatrix::from_row_n(&ineligible_locals, body.local_decls.len()),
};

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

let local_conflicts = visitor.local_conflicts;

Expand Down

0 comments on commit 21cd1fe

Please sign in to comment.