@@ -213,7 +213,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
213213 self . funclet ( fx) ,
214214 ) ;
215215 if fx. mir [ self . bb ] . is_cleanup {
216- bx. do_not_inline ( invokeret) ;
216+ bx. apply_attrs_to_cleanup_callsite ( invokeret) ;
217217 }
218218
219219 if let Some ( ( ret_dest, target) ) = destination {
@@ -228,11 +228,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
228228 } else {
229229 let llret = bx. call ( fn_ty, fn_attrs, Some ( & fn_abi) , fn_ptr, & llargs, self . funclet ( fx) ) ;
230230 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) ;
236232 }
237233
238234 if let Some ( ( ret_dest, target) ) = destination {
@@ -1627,7 +1623,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
16271623 let fn_ty = bx. fn_decl_backend_type ( & fn_abi) ;
16281624
16291625 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) ;
16311627
16321628 bx. unreachable ( ) ;
16331629
0 commit comments