reverse_postorder

This commit is contained in:
csmoe 2018-07-05 09:06:04 +08:00
parent 8fa9bfeb15
commit 37228fe632

View File

@ -16,6 +16,7 @@ use rustc_data_structures::bitslice::{bitwise, BitwiseOperator};
use rustc::ty::{self, TyCtxt}; use rustc::ty::{self, TyCtxt};
use rustc::mir::{self, Mir, BasicBlock, BasicBlockData, Location, Statement, Terminator}; use rustc::mir::{self, Mir, BasicBlock, BasicBlockData, Location, Statement, Terminator};
use rustc::mir::traversal;
use rustc::session::Session; use rustc::session::Session;
use std::borrow::Borrow; use std::borrow::Borrow;
@ -333,7 +334,7 @@ pub(crate) trait DataflowResultsConsumer<'a, 'tcx: 'a> {
fn analyze_results(&mut self, flow_uninit: &mut Self::FlowState) { fn analyze_results(&mut self, flow_uninit: &mut Self::FlowState) {
let flow = flow_uninit; 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); flow.reset_to_entry_of(bb);
self.process_basic_block(bb, flow); self.process_basic_block(bb, flow);
} }