@@ -36,13 +36,6 @@ pub struct Builder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
3636 /// see the `scope` module for more details
3737 scopes : Vec < scope:: Scope < ' tcx > > ,
3838
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-
4639 /// the current set of loops; see the `scope` module for more
4740 /// details
4841 loop_scopes : Vec < scope:: LoopScope > ,
@@ -82,30 +75,6 @@ impl Idx for ScopeId {
8275 }
8376}
8477
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-
10978///////////////////////////////////////////////////////////////////////////
11079/// The `BlockAnd` "monad" packages up the new basic block along with a
11180/// 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>,
158127 abi : Abi ,
159128 return_ty : Ty < ' gcx > ,
160129 ast_body : & ' gcx hir:: Expr )
161- -> ( Mir < ' tcx > , ScopeAuxiliaryVec )
130+ -> Mir < ' tcx >
162131 where A : Iterator < Item =( Ty < ' gcx > , Option < & ' gcx hir:: Pat > ) >
163132{
164133 let arguments: Vec < _ > = arguments. collect ( ) ;
@@ -221,15 +190,15 @@ pub fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
221190 } ) . collect ( )
222191 } ) ;
223192
224- let ( mut mir, aux ) = builder. finish ( upvar_decls, return_ty) ;
193+ let mut mir = builder. finish ( upvar_decls, return_ty) ;
225194 mir. spread_arg = spread_arg;
226- ( mir, aux )
195+ mir
227196}
228197
229198pub fn construct_const < ' a , ' gcx , ' tcx > ( hir : Cx < ' a , ' gcx , ' tcx > ,
230199 item_id : ast:: NodeId ,
231200 ast_expr : & ' tcx hir:: Expr )
232- -> ( Mir < ' tcx > , ScopeAuxiliaryVec ) {
201+ -> Mir < ' tcx > {
233202 let tcx = hir. tcx ( ) ;
234203 let ty = tcx. tables ( ) . expr_ty_adjusted ( ast_expr) ;
235204 let span = tcx. map . span ( item_id) ;
@@ -269,7 +238,6 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
269238 scopes : vec ! [ ] ,
270239 visibility_scopes : IndexVec :: new ( ) ,
271240 visibility_scope : ARGUMENT_VISIBILITY_SCOPE ,
272- scope_auxiliary : IndexVec :: new ( ) ,
273241 loop_scopes : vec ! [ ] ,
274242 local_decls : IndexVec :: from_elem_n ( LocalDecl :: new_return_pointer ( return_ty) , 1 ) ,
275243 var_indices : NodeMap ( ) ,
@@ -288,22 +256,22 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
288256 fn finish ( self ,
289257 upvar_decls : Vec < UpvarDecl > ,
290258 return_ty : Ty < ' tcx > )
291- -> ( Mir < ' tcx > , ScopeAuxiliaryVec ) {
259+ -> Mir < ' tcx > {
292260 for ( index, block) in self . cfg . basic_blocks . iter ( ) . enumerate ( ) {
293261 if block. terminator . is_none ( ) {
294262 span_bug ! ( self . fn_span, "no terminator on block {:?}" , index) ;
295263 }
296264 }
297265
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+ )
307275 }
308276
309277 fn args_and_body ( & mut self ,
0 commit comments