@@ -95,10 +95,10 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
9595
9696 debug ! ( "llblock: creating cleanup trampoline for {:?}" , target) ;
9797 let name = & format ! ( "{:?}_cleanup_trampoline_{:?}" , self . bb, target) ;
98- let trampoline = Bx :: append_block ( fx. cx , fx. llfn , name) ;
99- let mut trampoline_bx = Bx :: build ( fx. cx , trampoline ) ;
98+ let trampoline_llbb = Bx :: append_block ( fx. cx , fx. llfn , name) ;
99+ let mut trampoline_bx = Bx :: build ( fx. cx , trampoline_llbb ) ;
100100 trampoline_bx. cleanup_ret ( self . funclet ( fx) . unwrap ( ) , Some ( lltarget) ) ;
101- trampoline
101+ trampoline_llbb
102102 } else {
103103 lltarget
104104 }
@@ -1459,20 +1459,20 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
14591459 // bar();
14601460 // }
14611461 Some ( & mir:: TerminatorKind :: Abort ) => {
1462- let cs_bb =
1462+ let cs_llbb =
14631463 Bx :: append_block ( self . cx , self . llfn , & format ! ( "cs_funclet{:?}" , bb) ) ;
1464- let cp_bb =
1464+ let cp_llbb =
14651465 Bx :: append_block ( self . cx , self . llfn , & format ! ( "cp_funclet{:?}" , bb) ) ;
1466- ret_llbb = cs_bb ;
1466+ ret_llbb = cs_llbb ;
14671467
1468- let mut cs_bx = Bx :: build ( self . cx , cs_bb ) ;
1469- let cs = cs_bx. catch_switch ( None , None , & [ cp_bb ] ) ;
1468+ let mut cs_bx = Bx :: build ( self . cx , cs_llbb ) ;
1469+ let cs = cs_bx. catch_switch ( None , None , & [ cp_llbb ] ) ;
14701470
14711471 // The "null" here is actually a RTTI type descriptor for the
14721472 // C++ personality function, but `catch (...)` has no type so
14731473 // it's null. The 64 here is actually a bitfield which
14741474 // represents that this is a catch-all block.
1475- let mut cp_bx = Bx :: build ( self . cx , cp_bb ) ;
1475+ let mut cp_bx = Bx :: build ( self . cx , cp_llbb ) ;
14761476 let null = cp_bx. const_null (
14771477 cp_bx. type_i8p_ext ( cp_bx. cx ( ) . data_layout ( ) . instruction_address_space ) ,
14781478 ) ;
@@ -1481,30 +1481,31 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
14811481 cp_bx. br ( llbb) ;
14821482 }
14831483 _ => {
1484- let cleanup_bb =
1484+ let cleanup_llbb =
14851485 Bx :: append_block ( self . cx , self . llfn , & format ! ( "funclet_{:?}" , bb) ) ;
1486- ret_llbb = cleanup_bb ;
1487- let mut cleanup_bx = Bx :: build ( self . cx , cleanup_bb ) ;
1486+ ret_llbb = cleanup_llbb ;
1487+ let mut cleanup_bx = Bx :: build ( self . cx , cleanup_llbb ) ;
14881488 funclet = cleanup_bx. cleanup_pad ( None , & [ ] ) ;
14891489 cleanup_bx. br ( llbb) ;
14901490 }
14911491 }
14921492 self . funclets [ bb] = Some ( funclet) ;
14931493 ret_llbb
14941494 } else {
1495- let bb = Bx :: append_block ( self . cx , self . llfn , "cleanup" ) ;
1496- let mut bx = Bx :: build ( self . cx , bb ) ;
1495+ let cleanup_llbb = Bx :: append_block ( self . cx , self . llfn , "cleanup" ) ;
1496+ let mut cleanup_bx = Bx :: build ( self . cx , cleanup_llbb ) ;
14971497
14981498 let llpersonality = self . cx . eh_personality ( ) ;
14991499 let llretty = self . landing_pad_type ( ) ;
1500- let lp = bx . cleanup_landing_pad ( llretty, llpersonality) ;
1500+ let lp = cleanup_bx . cleanup_landing_pad ( llretty, llpersonality) ;
15011501
1502- let slot = self . get_personality_slot ( & mut bx) ;
1503- slot. storage_live ( & mut bx) ;
1504- Pair ( bx. extract_value ( lp, 0 ) , bx. extract_value ( lp, 1 ) ) . store ( & mut bx, slot) ;
1502+ let slot = self . get_personality_slot ( & mut cleanup_bx) ;
1503+ slot. storage_live ( & mut cleanup_bx) ;
1504+ Pair ( cleanup_bx. extract_value ( lp, 0 ) , cleanup_bx. extract_value ( lp, 1 ) )
1505+ . store ( & mut cleanup_bx, slot) ;
15051506
1506- bx . br ( llbb) ;
1507- bx . llbb ( )
1507+ cleanup_bx . br ( llbb) ;
1508+ cleanup_llbb
15081509 }
15091510 }
15101511
0 commit comments