Skip to content

Commit f81fc2a

Browse files
committed
the naked attribute no longer needs to be set by llvm/...
we're generating global asm now, so this attribute is meaningless for the codegen backend
1 parent c149836 commit f81fc2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
109109
sym::rustc_allocator_zeroed => {
110110
codegen_fn_attrs.flags |= CodegenFnAttrFlags::ALLOCATOR_ZEROED
111111
}
112-
sym::naked => codegen_fn_attrs.flags |= CodegenFnAttrFlags::NAKED,
112+
sym::naked => {
113+
// this attribute is ignored during codegen, because a function marked as naked is
114+
// turned into a global asm block.
115+
}
113116
sym::no_mangle => {
114117
if tcx.opt_item_name(did.to_def_id()).is_some() {
115118
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_MANGLE

0 commit comments

Comments
 (0)