@@ -166,7 +166,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
166166 bx. invoke ( fn_ty, fn_ptr, & llargs, ret_llbb, unwind_block, self . funclet ( fx) ) ;
167167 bx. apply_attrs_callsite ( & fn_abi, invokeret) ;
168168 if fx. mir [ self . bb ] . is_cleanup {
169- bx. do_not_inline ( invokeret) ;
169+ bx. apply_attrs_to_cleanup_callsite ( invokeret) ;
170170 }
171171
172172 if let Some ( ( ret_dest, target) ) = destination {
@@ -178,11 +178,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
178178 let llret = bx. call ( fn_ty, fn_ptr, & llargs, self . funclet ( fx) ) ;
179179 bx. apply_attrs_callsite ( & fn_abi, llret) ;
180180 if fx. mir [ self . bb ] . is_cleanup {
181- // Cleanup is always the cold path. Don't inline
182- // drop glue. Also, when there is a deeply-nested
183- // struct, there are "symmetry" issues that cause
184- // exponential inlining - see issue #41696.
185- bx. do_not_inline ( llret) ;
181+ bx. apply_attrs_to_cleanup_callsite ( llret) ;
186182 }
187183
188184 if let Some ( ( ret_dest, target) ) = destination {
@@ -1448,7 +1444,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
14481444
14491445 let llret = bx. call ( fn_ty, fn_ptr, & [ ] , None ) ;
14501446 bx. apply_attrs_callsite ( & fn_abi, llret) ;
1451- bx. do_not_inline ( llret) ;
1447+ bx. apply_attrs_to_cleanup_callsite ( llret) ;
14521448
14531449 bx. unreachable ( ) ;
14541450
0 commit comments