@@ -17,7 +17,7 @@ use super::super::MoveDataParamEnv;
17
17
use super :: super :: DropFlagState ;
18
18
use super :: super :: drop_flag_effects_for_function_entry;
19
19
use super :: super :: drop_flag_effects_for_location;
20
- use super :: super :: on_all_children_bits ;
20
+ use super :: super :: on_lookup_result_bits ;
21
21
22
22
use super :: { BitDenotation , BlockSets , DataflowOperator } ;
23
23
@@ -277,10 +277,9 @@ impl<'a, 'tcx> BitDenotation for MaybeInitializedLvals<'a, 'tcx> {
277
277
dest_lval : & repr:: Lvalue ) {
278
278
// when a call returns successfully, that means we need to set
279
279
// the bits for that dest_lval to 1 (initialized).
280
- let move_path_index = ctxt. move_data . rev_lookup . find ( dest_lval) ;
281
- on_all_children_bits ( self . tcx , self . mir , & ctxt. move_data ,
282
- move_path_index,
283
- |mpi| { in_out. add ( & mpi) ; } ) ;
280
+ on_lookup_result_bits ( self . tcx , self . mir , & ctxt. move_data ,
281
+ ctxt. move_data . rev_lookup . find ( dest_lval) ,
282
+ |mpi| { in_out. add ( & mpi) ; } ) ;
284
283
}
285
284
}
286
285
@@ -338,11 +337,10 @@ impl<'a, 'tcx> BitDenotation for MaybeUninitializedLvals<'a, 'tcx> {
338
337
_dest_bb : repr:: BasicBlock ,
339
338
dest_lval : & repr:: Lvalue ) {
340
339
// when a call returns successfully, that means we need to set
341
- // the bits for that dest_lval to 1 (initialized).
342
- let move_path_index = ctxt. move_data . rev_lookup . find ( dest_lval) ;
343
- on_all_children_bits ( self . tcx , self . mir , & ctxt. move_data ,
344
- move_path_index,
345
- |mpi| { in_out. remove ( & mpi) ; } ) ;
340
+ // the bits for that dest_lval to 0 (initialized).
341
+ on_lookup_result_bits ( self . tcx , self . mir , & ctxt. move_data ,
342
+ ctxt. move_data . rev_lookup . find ( dest_lval) ,
343
+ |mpi| { in_out. remove ( & mpi) ; } ) ;
346
344
}
347
345
}
348
346
@@ -400,10 +398,9 @@ impl<'a, 'tcx> BitDenotation for DefinitelyInitializedLvals<'a, 'tcx> {
400
398
dest_lval : & repr:: Lvalue ) {
401
399
// when a call returns successfully, that means we need to set
402
400
// the bits for that dest_lval to 1 (initialized).
403
- let move_path_index = ctxt. move_data . rev_lookup . find ( dest_lval) ;
404
- on_all_children_bits ( self . tcx , self . mir , & ctxt. move_data ,
405
- move_path_index,
406
- |mpi| { in_out. add ( & mpi) ; } ) ;
401
+ on_lookup_result_bits ( self . tcx , self . mir , & ctxt. move_data ,
402
+ ctxt. move_data . rev_lookup . find ( dest_lval) ,
403
+ |mpi| { in_out. add ( & mpi) ; } ) ;
407
404
}
408
405
}
409
406
@@ -448,11 +445,10 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
448
445
// assigning into this `lvalue` kills all
449
446
// MoveOuts from it, and *also* all MoveOuts
450
447
// for children and associated fragment sets.
451
- let move_path_index = rev_lookup. find ( lvalue) ;
452
- on_all_children_bits ( tcx,
448
+ on_lookup_result_bits ( tcx,
453
449
mir,
454
450
move_data,
455
- move_path_index ,
451
+ rev_lookup . find ( lvalue ) ,
456
452
|mpi| for moi in & path_map[ mpi] {
457
453
assert ! ( moi. index( ) < bits_per_block) ;
458
454
sets. kill_set . add ( & moi) ;
@@ -489,18 +485,17 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
489
485
_dest_bb : repr:: BasicBlock ,
490
486
dest_lval : & repr:: Lvalue ) {
491
487
let move_data = & ctxt. move_data ;
492
- let move_path_index = move_data. rev_lookup . find ( dest_lval) ;
493
488
let bits_per_block = self . bits_per_block ( ctxt) ;
494
489
495
490
let path_map = & move_data. path_map ;
496
- on_all_children_bits ( self . tcx ,
497
- self . mir ,
498
- move_data,
499
- move_path_index ,
500
- |mpi| for moi in & path_map[ mpi] {
501
- assert ! ( moi. index( ) < bits_per_block) ;
502
- in_out. remove ( & moi) ;
503
- } ) ;
491
+ on_lookup_result_bits ( self . tcx ,
492
+ self . mir ,
493
+ move_data,
494
+ move_data . rev_lookup . find ( dest_lval ) ,
495
+ |mpi| for moi in & path_map[ mpi] {
496
+ assert ! ( moi. index( ) < bits_per_block) ;
497
+ in_out. remove ( & moi) ;
498
+ } ) ;
504
499
}
505
500
}
506
501
0 commit comments