@@ -289,16 +289,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
289
289
bx. cleanup_ret ( funclet, None ) ;
290
290
} else {
291
291
let slot = self . get_personality_slot ( bx) ;
292
- let lp0 = slot. project_field ( bx, 0 ) ;
293
- let lp0 = bx. load_operand ( lp0 ) . immediate ( ) ;
294
- let lp1 = slot. project_field ( bx, 1 ) ;
295
- let lp1 = bx. load_operand ( lp1 ) . immediate ( ) ;
292
+ let exn0 = slot. project_field ( bx, 0 ) ;
293
+ let exn0 = bx. load_operand ( exn0 ) . immediate ( ) ;
294
+ let exn1 = slot. project_field ( bx, 1 ) ;
295
+ let exn1 = bx. load_operand ( exn1 ) . immediate ( ) ;
296
296
slot. storage_dead ( bx) ;
297
297
298
- let mut lp = bx. const_undef ( self . landing_pad_type ( ) ) ;
299
- lp = bx. insert_value ( lp, lp0, 0 ) ;
300
- lp = bx. insert_value ( lp, lp1, 1 ) ;
301
- bx. resume ( lp) ;
298
+ bx. resume ( exn0, exn1) ;
302
299
}
303
300
}
304
301
@@ -1636,24 +1633,17 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1636
1633
let mut cleanup_bx = Bx :: build ( self . cx , cleanup_llbb) ;
1637
1634
1638
1635
let llpersonality = self . cx . eh_personality ( ) ;
1639
- let llretty = self . landing_pad_type ( ) ;
1640
- let lp = cleanup_bx. cleanup_landing_pad ( llretty, llpersonality) ;
1636
+ let ( exn0, exn1) = cleanup_bx. cleanup_landing_pad ( llpersonality) ;
1641
1637
1642
1638
let slot = self . get_personality_slot ( & mut cleanup_bx) ;
1643
1639
slot. storage_live ( & mut cleanup_bx) ;
1644
- Pair ( cleanup_bx. extract_value ( lp, 0 ) , cleanup_bx. extract_value ( lp, 1 ) )
1645
- . store ( & mut cleanup_bx, slot) ;
1640
+ Pair ( exn0, exn1) . store ( & mut cleanup_bx, slot) ;
1646
1641
1647
1642
cleanup_bx. br ( llbb) ;
1648
1643
cleanup_llbb
1649
1644
}
1650
1645
}
1651
1646
1652
- fn landing_pad_type ( & self ) -> Bx :: Type {
1653
- let cx = self . cx ;
1654
- cx. type_struct ( & [ cx. type_i8p ( ) , cx. type_i32 ( ) ] , false )
1655
- }
1656
-
1657
1647
fn unreachable_block ( & mut self ) -> Bx :: BasicBlock {
1658
1648
self . unreachable_block . unwrap_or_else ( || {
1659
1649
let llbb = Bx :: append_block ( self . cx , self . llfn , "unreachable" ) ;
@@ -1673,8 +1663,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1673
1663
self . set_debug_loc ( & mut bx, mir:: SourceInfo :: outermost ( self . mir . span ) ) ;
1674
1664
1675
1665
let llpersonality = self . cx . eh_personality ( ) ;
1676
- let llretty = self . landing_pad_type ( ) ;
1677
- bx. cleanup_landing_pad ( llretty, llpersonality) ;
1666
+ bx. cleanup_landing_pad ( llpersonality) ;
1678
1667
1679
1668
let ( fn_abi, fn_ptr) = common:: build_langcall ( & bx, None , LangItem :: PanicNoUnwind ) ;
1680
1669
let fn_ty = bx. fn_decl_backend_type ( & fn_abi) ;
0 commit comments