1
Fork 0

Rollup merge of #105193 - tmiasko:naked-nocoverage, r=wesleywiser

Disable coverage instrumentation for naked functions

Fixes #105170.
This commit is contained in:
Matthias Krüger 2022-12-03 17:37:44 +01:00 committed by GitHub
commit ed9a21eb0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 11 deletions

View file

@ -258,13 +258,12 @@ pub fn from_fn_attrs<'ll, 'tcx>(
OptimizeAttr::Speed => {}
}
let inline = if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NAKED) {
InlineAttr::Never
} else if codegen_fn_attrs.inline == InlineAttr::None && instance.def.requires_inline(cx.tcx) {
InlineAttr::Hint
} else {
codegen_fn_attrs.inline
};
let inline =
if codegen_fn_attrs.inline == InlineAttr::None && instance.def.requires_inline(cx.tcx) {
InlineAttr::Hint
} else {
codegen_fn_attrs.inline
};
to_add.extend(inline_attr(cx, inline));
// The `uwtable` attribute according to LLVM is: