about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2020-02-28 20:57:36 -0800
committerDylan MacKenzie <ecstaticmorse@gmail.com>2020-02-28 21:29:21 -0800
commit21cd1fe0bddf68062d6edd858781eaffd0dfcaaa (patch)
treeef546ce0ce067ff50a3857434b8f2d4a7252ce50 /src
parent75d256fc61afc70af8f093a14f8b7c02185396ee (diff)
downloadrust-21cd1fe0bddf68062d6edd858781eaffd0dfcaaa.tar.gz
rust-21cd1fe0bddf68062d6edd858781eaffd0dfcaaa.zip
Process `RequiresStorage` results in pre-order
Reverse post-order requires an allocation.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/transform/generator.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs
index 770f93517d0..3107be1b622 100644
--- a/src/librustc_mir/transform/generator.rs
+++ b/src/librustc_mir/transform/generator.rs
@@ -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;