@@ -98,21 +98,17 @@ pub struct Postorder<'a, 'tcx> {
9898 basic_blocks : & ' a IndexSlice < BasicBlock , BasicBlockData < ' tcx > > ,
9999 visited : DenseBitSet < BasicBlock > ,
100100 visit_stack : Vec < ( BasicBlock , Successors < ' a > ) > ,
101- /// A non-empty `extra` allows for a precise calculation of the successors.
102- extra : Option < ( TyCtxt < ' tcx > , Instance < ' tcx > ) > ,
103101}
104102
105103impl < ' a , ' tcx > Postorder < ' a , ' tcx > {
106104 pub fn new (
107105 basic_blocks : & ' a IndexSlice < BasicBlock , BasicBlockData < ' tcx > > ,
108106 root : BasicBlock ,
109- extra : Option < ( TyCtxt < ' tcx > , Instance < ' tcx > ) > ,
110107 ) -> Postorder < ' a , ' tcx > {
111108 let mut po = Postorder {
112109 basic_blocks,
113110 visited : DenseBitSet :: new_empty ( basic_blocks. len ( ) ) ,
114111 visit_stack : Vec :: new ( ) ,
115- extra,
116112 } ;
117113
118114 po. visit ( root) ;
@@ -126,11 +122,7 @@ impl<'a, 'tcx> Postorder<'a, 'tcx> {
126122 return ;
127123 }
128124 let data = & self . basic_blocks [ bb] ;
129- let successors = if let Some ( extra) = self . extra {
130- data. mono_successors ( extra. 0 , extra. 1 )
131- } else {
132- data. terminator ( ) . successors ( )
133- } ;
125+ let successors = data. terminator ( ) . successors ( ) ;
134126 self . visit_stack . push ( ( bb, successors) ) ;
135127 }
136128
@@ -225,20 +217,6 @@ pub fn postorder<'a, 'tcx>(
225217 reverse_postorder ( body) . rev ( )
226218}
227219
228- pub fn mono_reachable_reverse_postorder < ' a , ' tcx > (
229- body : & ' a Body < ' tcx > ,
230- tcx : TyCtxt < ' tcx > ,
231- instance : Instance < ' tcx > ,
232- ) -> Vec < BasicBlock > {
233- let mut iter = Postorder :: new ( & body. basic_blocks , START_BLOCK , Some ( ( tcx, instance) ) ) ;
234- let mut items = Vec :: with_capacity ( body. basic_blocks . len ( ) ) ;
235- while let Some ( block) = iter. next ( ) {
236- items. push ( block) ;
237- }
238- items. reverse ( ) ;
239- items
240- }
241-
242220/// Returns an iterator over all basic blocks reachable from the `START_BLOCK` in no particular
243221/// order.
244222///
0 commit comments