Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visit the mir basic blocks in reverse-postfix order #52067

Merged
merged 2 commits into from
Jul 7, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
reverse_postorder
  • Loading branch information
csmoe committed Jul 5, 2018
commit 37228fe63286a920ad18cf72d37dfe69c7e8dc2d
3 changes: 2 additions & 1 deletion src/librustc_mir/dataflow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use rustc_data_structures::bitslice::{bitwise, BitwiseOperator};

use rustc::ty::{self, TyCtxt};
use rustc::mir::{self, Mir, BasicBlock, BasicBlockData, Location, Statement, Terminator};
use rustc::mir::traversal;
use rustc::session::Session;

use std::borrow::Borrow;
Expand Down Expand Up @@ -333,7 +334,7 @@ pub(crate) trait DataflowResultsConsumer<'a, 'tcx: 'a> {

fn analyze_results(&mut self, flow_uninit: &mut Self::FlowState) {
let flow = flow_uninit;
for bb in self.mir().basic_blocks().indices() {
for (bb, _) in traversal::reverse_postorder(self.mir()) {
flow.reset_to_entry_of(bb);
self.process_basic_block(bb, flow);
}
Expand Down