@@ -547,11 +547,13 @@ struct Liveness<'a> {
547547
548548impl < ' a > Liveness < ' a > {
549549 fn new ( ir : & ' a mut IrMaps < ' a > , specials : Specials ) -> Liveness < ' a > {
550+ let num_live_nodes = ir. num_live_nodes ;
551+ let num_vars = ir. num_vars ;
550552 Liveness {
551553 ir : ir,
552554 s : specials,
553- successors : Vec :: from_elem ( ir . num_live_nodes , invalid_node ( ) ) ,
554- users : Vec :: from_elem ( ir . num_live_nodes * ir . num_vars , invalid_users ( ) ) ,
555+ successors : Vec :: from_elem ( num_live_nodes, invalid_node ( ) ) ,
556+ users : Vec :: from_elem ( num_live_nodes * num_vars, invalid_users ( ) ) ,
555557 loop_scope : Vec :: new ( ) ,
556558 break_ln : NodeMap :: new ( ) ,
557559 cont_ln : NodeMap :: new ( ) ,
@@ -826,8 +828,9 @@ impl<'a> Liveness<'a> {
826828
827829 debug ! ( "compute: using id for block, {}" , block_to_str( body) ) ;
828830
831+ let exit_ln = self . s . exit_ln ;
829832 let entry_ln: LiveNode =
830- self . with_loop_nodes ( body. id , self . s . exit_ln , self . s . exit_ln ,
833+ self . with_loop_nodes ( body. id , exit_ln, exit_ln,
831834 |this| this. propagate_through_fn_block ( decl, body) ) ;
832835
833836 // hack to skip the loop unless debug! is enabled:
@@ -847,12 +850,13 @@ impl<'a> Liveness<'a> {
847850 -> LiveNode {
848851 // the fallthrough exit is only for those cases where we do not
849852 // explicitly return:
850- self . init_from_succ ( self . s . fallthrough_ln , self . s . exit_ln ) ;
853+ let s = self . s ;
854+ self . init_from_succ ( s. fallthrough_ln , s. exit_ln ) ;
851855 if blk. expr . is_none ( ) {
852- self . acc ( self . s . fallthrough_ln , self . s . no_ret_var , ACC_READ )
856+ self . acc ( s. fallthrough_ln , s. no_ret_var , ACC_READ )
853857 }
854858
855- self . propagate_through_block ( blk, self . s . fallthrough_ln )
859+ self . propagate_through_block ( blk, s. fallthrough_ln )
856860 }
857861
858862 fn propagate_through_block ( & mut self , blk : & Block , succ : LiveNode )
@@ -1036,7 +1040,8 @@ impl<'a> Liveness<'a> {
10361040
10371041 ExprRet ( o_e) => {
10381042 // ignore succ and subst exit_ln:
1039- self . propagate_through_opt_expr ( o_e, self . s . exit_ln )
1043+ let exit_ln = self . s . exit_ln ;
1044+ self . propagate_through_opt_expr ( o_e, exit_ln)
10401045 }
10411046
10421047 ExprBreak ( opt_label) => {
0 commit comments