@@ -370,8 +370,10 @@ fn compile_submatch(bcx: block, m: match, vals: [ValueRef],
370
370
let loc = local_mem( option:: get( assoc( key, m[ 0 ] . bound) ) ) ;
371
371
bcx. fcx . lllocals . insert ( val, loc) ;
372
372
} ;
373
- let { bcx: guard_cx , val} = with_scope_result ( bcx, "guard" ) { |bcx|
374
- trans_temp_expr ( bcx, e)
373
+ let { bcx: guard_cx , val} = {
374
+ with_scope_result ( bcx, e. info ( ) , "guard" ) { |bcx|
375
+ trans_temp_expr ( bcx, e)
376
+ }
375
377
} ;
376
378
bcx = with_cond ( guard_cx, Not ( guard_cx, val) ) { |bcx|
377
379
compile_submatch ( bcx, vec:: tail ( m) , vals, chk, exits) ;
@@ -517,19 +519,20 @@ fn compile_submatch(bcx: block, m: match, vals: [ValueRef],
517
519
}
518
520
compare {
519
521
let t = node_id_type ( bcx, pat_id) ;
520
- let { bcx: after_cx , val: matches} =
521
- with_scope_result ( bcx, "compare_scope" ) { |bcx|
522
- alt trans_opt ( bcx, opt) {
523
- single_result ( { bcx, val} ) {
524
- trans_compare ( bcx, ast:: eq, test_val, t, val, t)
525
- }
526
- range_result ( { val: vbegin, _} , { bcx, val: vend} ) {
527
- let { bcx, val: ge } = trans_compare (
528
- bcx, ast:: ge, test_val, t, vbegin, t) ;
529
- let { bcx, val: le } = trans_compare (
530
- bcx, ast:: le, test_val, t, vend, t) ;
531
- { bcx: bcx, val: And ( bcx, ge, le) }
532
- }
522
+ let { bcx: after_cx , val: matches} = {
523
+ with_scope_result ( bcx, none, "compare_scope" ) { |bcx|
524
+ alt trans_opt ( bcx, opt) {
525
+ single_result ( { bcx, val} ) {
526
+ trans_compare ( bcx, ast:: eq, test_val, t, val, t)
527
+ }
528
+ range_result ( { val: vbegin, _} , { bcx, val: vend} ) {
529
+ let { bcx, val: ge } = trans_compare (
530
+ bcx, ast:: ge, test_val, t, vbegin, t) ;
531
+ let { bcx, val: le } = trans_compare (
532
+ bcx, ast:: le, test_val, t, vend, t) ;
533
+ { bcx: bcx, val: And ( bcx, ge, le) }
534
+ }
535
+ }
533
536
}
534
537
} ;
535
538
bcx = sub_block ( after_cx, "compare_next" ) ;
@@ -608,10 +611,14 @@ fn make_phi_bindings(bcx: block, map: [exit_node],
608
611
ret success;
609
612
}
610
613
611
- fn trans_alt( bcx: block, expr: @ast:: expr, arms: [ ast:: arm] ,
612
- mode: ast:: alt_mode, dest: dest) -> block {
614
+ fn trans_alt( bcx: block,
615
+ alt_expr: @ast:: expr,
616
+ expr: @ast:: expr,
617
+ arms: [ ast:: arm] ,
618
+ mode: ast:: alt_mode,
619
+ dest: dest) -> block {
613
620
let _icx = bcx. insn_ctxt( "alt::trans_alt" ) ;
614
- with_scope( bcx, "alt" ) { |bcx|
621
+ with_scope( bcx, alt_expr . info ( ) , "alt" ) { |bcx|
615
622
trans_alt_inner( bcx, expr, arms, mode, dest)
616
623
}
617
624
}
@@ -626,8 +633,7 @@ fn trans_alt_inner(scope_cx: block, expr: @ast::expr, arms: [ast::arm],
626
633
if bcx. unreachable { ret bcx; }
627
634
628
635
for vec:: each( arms) { |a|
629
- let body = scope_block( bcx, "case_body" ) ;
630
- body. block_span = some( a. body. span) ;
636
+ let body = scope_block( bcx, a. body. info( ) , "case_body" ) ;
631
637
let id_map = pat_util:: pat_id_map( tcx. def_map, a. pats[ 0 ] ) ;
632
638
bodies += [ body] ;
633
639
for vec:: each( a. pats) { |p|
0 commit comments