use rustc_apfloat::ieee::{Double, Single};
use rustc_apfloat::Float;
use rustc_data_structures::control_flow_graph::dominators::{dominators, Dominators};
-use rustc_data_structures::control_flow_graph::ControlFlowGraph;
+use rustc_data_structures::control_flow_graph;
use rustc_data_structures::control_flow_graph::{GraphPredecessors, GraphSuccessors};
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
use rustc_data_structures::small_vec::SmallVec;
ty::tls::with(|tcx| tcx.item_path_str(def_id))
}
-impl<'tcx> ControlFlowGraph for Mir<'tcx> {
+impl<'tcx> control_flow_graph::DirectedGraph for Mir<'tcx> {
type Node = BasicBlock;
+}
+impl<'tcx> control_flow_graph::WithNumNodes for Mir<'tcx> {
fn num_nodes(&self) -> usize {
self.basic_blocks.len()
}
+}
+impl<'tcx> control_flow_graph::WithStartNode for Mir<'tcx> {
fn start_node(&self) -> Self::Node {
START_BLOCK
}
+}
+impl<'tcx> control_flow_graph::WithPredecessors for Mir<'tcx> {
fn predecessors<'graph>(
&'graph self,
node: Self::Node,
) -> <Self as GraphPredecessors<'graph>>::Iter {
self.predecessors_for(node).clone().into_iter()
}
+}
+
+impl<'tcx> control_flow_graph::WithSuccessors for Mir<'tcx> {
fn successors<'graph>(
&'graph self,
node: Self::Node,
}
}
-impl<'a, 'b> GraphPredecessors<'b> for Mir<'a> {
+impl<'a, 'b> control_flow_graph::GraphPredecessors<'b> for Mir<'a> {
type Item = BasicBlock;
type Iter = IntoIter<BasicBlock>;
}
-impl<'a, 'b> GraphSuccessors<'b> for Mir<'a> {
+impl<'a, 'b> control_flow_graph::GraphSuccessors<'b> for Mir<'a> {
type Item = BasicBlock;
type Iter = iter::Cloned<Successors<'b>>;
}