@@ -213,7 +213,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
213
213
self . funclet ( fx) ,
214
214
) ;
215
215
if fx. mir [ self . bb ] . is_cleanup {
216
- bx. do_not_inline ( invokeret) ;
216
+ bx. apply_attrs_to_cleanup_callsite ( invokeret) ;
217
217
}
218
218
219
219
if let Some ( ( ret_dest, target) ) = destination {
@@ -228,11 +228,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
228
228
} else {
229
229
let llret = bx. call ( fn_ty, fn_attrs, Some ( & fn_abi) , fn_ptr, & llargs, self . funclet ( fx) ) ;
230
230
if fx. mir [ self . bb ] . is_cleanup {
231
- // Cleanup is always the cold path. Don't inline
232
- // drop glue. Also, when there is a deeply-nested
233
- // struct, there are "symmetry" issues that cause
234
- // exponential inlining - see issue #41696.
235
- bx. do_not_inline ( llret) ;
231
+ bx. apply_attrs_to_cleanup_callsite ( llret) ;
236
232
}
237
233
238
234
if let Some ( ( ret_dest, target) ) = destination {
@@ -1627,7 +1623,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1627
1623
let fn_ty = bx. fn_decl_backend_type ( & fn_abi) ;
1628
1624
1629
1625
let llret = bx. call ( fn_ty, None , Some ( & fn_abi) , fn_ptr, & [ ] , funclet. as_ref ( ) ) ;
1630
- bx. do_not_inline ( llret) ;
1626
+ bx. apply_attrs_to_cleanup_callsite ( llret) ;
1631
1627
1632
1628
bx. unreachable ( ) ;
1633
1629
0 commit comments