@@ -98,21 +98,17 @@ pub struct Postorder<'a, 'tcx> {
98
98
basic_blocks : & ' a IndexSlice < BasicBlock , BasicBlockData < ' tcx > > ,
99
99
visited : DenseBitSet < BasicBlock > ,
100
100
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 > ) > ,
103
101
}
104
102
105
103
impl < ' a , ' tcx > Postorder < ' a , ' tcx > {
106
104
pub fn new (
107
105
basic_blocks : & ' a IndexSlice < BasicBlock , BasicBlockData < ' tcx > > ,
108
106
root : BasicBlock ,
109
- extra : Option < ( TyCtxt < ' tcx > , Instance < ' tcx > ) > ,
110
107
) -> Postorder < ' a , ' tcx > {
111
108
let mut po = Postorder {
112
109
basic_blocks,
113
110
visited : DenseBitSet :: new_empty ( basic_blocks. len ( ) ) ,
114
111
visit_stack : Vec :: new ( ) ,
115
- extra,
116
112
} ;
117
113
118
114
po. visit ( root) ;
@@ -126,11 +122,7 @@ impl<'a, 'tcx> Postorder<'a, 'tcx> {
126
122
return ;
127
123
}
128
124
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 ( ) ;
134
126
self . visit_stack . push ( ( bb, successors) ) ;
135
127
}
136
128
@@ -225,20 +217,6 @@ pub fn postorder<'a, 'tcx>(
225
217
reverse_postorder ( body) . rev ( )
226
218
}
227
219
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
-
242
220
/// Returns an iterator over all basic blocks reachable from the `START_BLOCK` in no particular
243
221
/// order.
244
222
///
0 commit comments