@@ -1783,8 +1783,7 @@ fn trans_while(cx: block, cond: @ast::expr, body: ast::blk)
1783
1783
-> block {
1784
1784
let _icx = cx. insn_ctxt ( "trans_while" ) ;
1785
1785
let next_cx = sub_block ( cx, "while next" ) ;
1786
- let loop_cx = loop_scope_block ( cx, cont_self, next_cx,
1787
- "while loop" , body. span ) ;
1786
+ let loop_cx = loop_scope_block ( cx, next_cx, "`while`" , body. span ) ;
1788
1787
let cond_cx = scope_block ( loop_cx, "while loop cond" ) ;
1789
1788
let body_cx = scope_block ( loop_cx, "while loop body" ) ;
1790
1789
Br ( cx, loop_cx. llbb ) ;
@@ -1800,9 +1799,7 @@ fn trans_while(cx: block, cond: @ast::expr, body: ast::blk)
1800
1799
fn trans_loop ( cx : block , body : ast:: blk ) -> block {
1801
1800
let _icx = cx. insn_ctxt ( "trans_loop" ) ;
1802
1801
let next_cx = sub_block ( cx, "next" ) ;
1803
- let body_cx =
1804
- loop_scope_block ( cx, cont_self, next_cx,
1805
- "infinite loop body" , body. span ) ;
1802
+ let body_cx = loop_scope_block ( cx, next_cx, "`loop`" , body. span ) ;
1806
1803
let body_end = trans_block ( body_cx, body, ignore) ;
1807
1804
cleanup_and_Br ( body_end, body_cx, body_cx. llbb ) ;
1808
1805
Br ( cx, body_cx. llbb ) ;
@@ -3567,14 +3564,11 @@ fn trans_break_cont(bcx: block, to_end: bool)
3567
3564
let mut target = bcx;
3568
3565
loop {
3569
3566
alt unwind. kind {
3570
- block_scope ( { is_loop : some( { cnt , brk} ) , _} ) {
3567
+ block_scope ( { loop_break : some( brk) , _} ) {
3571
3568
target = if to_end {
3572
3569
brk
3573
3570
} else {
3574
- alt cnt {
3575
- cont_other( o) { o }
3576
- cont_self { unwind }
3577
- }
3571
+ unwind
3578
3572
} ;
3579
3573
break ;
3580
3574
}
@@ -3755,7 +3749,7 @@ fn new_block(cx: fn_ctxt, parent: block_parent, kind: block_kind,
3755
3749
}
3756
3750
3757
3751
fn simple_block_scope ( ) -> block_kind {
3758
- block_scope ( { is_loop : none, mut cleanups: [ ] ,
3752
+ block_scope ( { loop_break : none, mut cleanups: [ ] ,
3759
3753
mut cleanup_paths: [ ] , mut landing_pad: none} )
3760
3754
}
3761
3755
@@ -3770,11 +3764,10 @@ fn scope_block(bcx: block, n: str) -> block {
3770
3764
n, none) ;
3771
3765
}
3772
3766
3773
- fn loop_scope_block ( bcx : block , _cont : loop_cont ,
3774
- _break : block , n : str , sp : span )
3767
+ fn loop_scope_block ( bcx : block , loop_break : block , n : str , sp : span )
3775
3768
-> block {
3776
3769
ret new_block ( bcx. fcx , parent_some ( bcx) , block_scope ( {
3777
- is_loop : some( { cnt : _cont , brk : _break } ) ,
3770
+ loop_break : some( loop_break ) ,
3778
3771
mut cleanups: [ ] ,
3779
3772
mut cleanup_paths: [ ] ,
3780
3773
mut landing_pad: none
0 commit comments