@@ -36,13 +36,6 @@ pub struct Builder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
36
36
/// see the `scope` module for more details
37
37
scopes : Vec < scope:: Scope < ' tcx > > ,
38
38
39
- /// for each scope, a span of blocks that defines it;
40
- /// we track these for use in region and borrow checking,
41
- /// but these are liable to get out of date once optimization
42
- /// begins. They are also hopefully temporary, and will be
43
- /// no longer needed when we adopt graph-based regions.
44
- scope_auxiliary : IndexVec < ScopeId , ScopeAuxiliary > ,
45
-
46
39
/// the current set of loops; see the `scope` module for more
47
40
/// details
48
41
loop_scopes : Vec < scope:: LoopScope > ,
@@ -82,30 +75,6 @@ impl Idx for ScopeId {
82
75
}
83
76
}
84
77
85
- /// For each scope, we track the extent (from the HIR) and a
86
- /// single-entry-multiple-exit subgraph that contains all the
87
- /// statements/terminators within it.
88
- ///
89
- /// This information is separated out from the main `ScopeData`
90
- /// because it is short-lived. First, the extent contains node-ids,
91
- /// so it cannot be saved and re-loaded. Second, any optimization will mess up
92
- /// the dominator/postdominator information.
93
- ///
94
- /// The intention is basically to use this information to do
95
- /// regionck/borrowck and then throw it away once we are done.
96
- pub struct ScopeAuxiliary {
97
- /// extent of this scope from the MIR.
98
- pub extent : CodeExtent ,
99
-
100
- /// "entry point": dominator of all nodes in the scope
101
- pub dom : Location ,
102
-
103
- /// "exit points": mutual postdominators of all nodes in the scope
104
- pub postdoms : Vec < Location > ,
105
- }
106
-
107
- pub type ScopeAuxiliaryVec = IndexVec < ScopeId , ScopeAuxiliary > ;
108
-
109
78
///////////////////////////////////////////////////////////////////////////
110
79
/// The `BlockAnd` "monad" packages up the new basic block along with a
111
80
/// produced value (sometimes just unit, of course). The `unpack!`
@@ -158,7 +127,7 @@ pub fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
158
127
abi : Abi ,
159
128
return_ty : Ty < ' gcx > ,
160
129
ast_body : & ' gcx hir:: Expr )
161
- -> ( Mir < ' tcx > , ScopeAuxiliaryVec )
130
+ -> Mir < ' tcx >
162
131
where A : Iterator < Item =( Ty < ' gcx > , Option < & ' gcx hir:: Pat > ) >
163
132
{
164
133
let arguments: Vec < _ > = arguments. collect ( ) ;
@@ -221,15 +190,15 @@ pub fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
221
190
} ) . collect ( )
222
191
} ) ;
223
192
224
- let ( mut mir, aux ) = builder. finish ( upvar_decls, return_ty) ;
193
+ let mut mir = builder. finish ( upvar_decls, return_ty) ;
225
194
mir. spread_arg = spread_arg;
226
- ( mir, aux )
195
+ mir
227
196
}
228
197
229
198
pub fn construct_const < ' a , ' gcx , ' tcx > ( hir : Cx < ' a , ' gcx , ' tcx > ,
230
199
item_id : ast:: NodeId ,
231
200
ast_expr : & ' tcx hir:: Expr )
232
- -> ( Mir < ' tcx > , ScopeAuxiliaryVec ) {
201
+ -> Mir < ' tcx > {
233
202
let tcx = hir. tcx ( ) ;
234
203
let ty = tcx. tables ( ) . expr_ty_adjusted ( ast_expr) ;
235
204
let span = tcx. map . span ( item_id) ;
@@ -269,7 +238,6 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
269
238
scopes : vec ! [ ] ,
270
239
visibility_scopes : IndexVec :: new ( ) ,
271
240
visibility_scope : ARGUMENT_VISIBILITY_SCOPE ,
272
- scope_auxiliary : IndexVec :: new ( ) ,
273
241
loop_scopes : vec ! [ ] ,
274
242
local_decls : IndexVec :: from_elem_n ( LocalDecl :: new_return_pointer ( return_ty) , 1 ) ,
275
243
var_indices : NodeMap ( ) ,
@@ -288,22 +256,22 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
288
256
fn finish ( self ,
289
257
upvar_decls : Vec < UpvarDecl > ,
290
258
return_ty : Ty < ' tcx > )
291
- -> ( Mir < ' tcx > , ScopeAuxiliaryVec ) {
259
+ -> Mir < ' tcx > {
292
260
for ( index, block) in self . cfg . basic_blocks . iter ( ) . enumerate ( ) {
293
261
if block. terminator . is_none ( ) {
294
262
span_bug ! ( self . fn_span, "no terminator on block {:?}" , index) ;
295
263
}
296
264
}
297
265
298
- ( Mir :: new ( self . cfg . basic_blocks ,
299
- self . visibility_scopes ,
300
- IndexVec :: new ( ) ,
301
- return_ty,
302
- self . local_decls ,
303
- self . arg_count ,
304
- upvar_decls,
305
- self . fn_span
306
- ) , self . scope_auxiliary )
266
+ Mir :: new ( self . cfg . basic_blocks ,
267
+ self . visibility_scopes ,
268
+ IndexVec :: new ( ) ,
269
+ return_ty,
270
+ self . local_decls ,
271
+ self . arg_count ,
272
+ upvar_decls,
273
+ self . fn_span
274
+ )
307
275
}
308
276
309
277
fn args_and_body ( & mut self ,
0 commit comments