1
Fork 0

Mark naked functions as never inline in codegen_fn_attrs

Use code generation attributes to ensure that naked functions are never
inline, replacing separate checks in MIR inliner and LLVM code
generation.
This commit is contained in:
Tomasz Miąsko 2022-12-02 00:00:00 +00:00
parent c955add18c
commit b740cdcf43
3 changed files with 7 additions and 11 deletions

View file

@ -2075,6 +2075,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NAKED) {
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_COVERAGE;
codegen_fn_attrs.inline = InlineAttr::Never;
}
// Weak lang items have the same semantics as "std internal" symbols in the