Automatically enable cross-crate inlining for small functions
This commit is contained in:
parent
09df6108c8
commit
33b0e4be06
67 changed files with 434 additions and 344 deletions
|
@ -245,16 +245,15 @@ impl<'tcx> InstanceDef<'tcx> {
|
|||
// drops of `Option::None` before LTO. We also respect the intent of
|
||||
// `#[inline]` on `Drop::drop` implementations.
|
||||
return ty.ty_adt_def().map_or(true, |adt_def| {
|
||||
adt_def.destructor(tcx).map_or_else(
|
||||
|| adt_def.is_enum(),
|
||||
|dtor| tcx.codegen_fn_attrs(dtor.did).requests_inline(),
|
||||
)
|
||||
adt_def
|
||||
.destructor(tcx)
|
||||
.map_or_else(|| adt_def.is_enum(), |dtor| tcx.cross_crate_inlinable(dtor.did))
|
||||
});
|
||||
}
|
||||
if let ty::InstanceDef::ThreadLocalShim(..) = *self {
|
||||
return false;
|
||||
}
|
||||
tcx.codegen_fn_attrs(self.def_id()).requests_inline()
|
||||
tcx.cross_crate_inlinable(self.def_id())
|
||||
}
|
||||
|
||||
pub fn requires_caller_location(&self, tcx: TyCtxt<'_>) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue