centralize -Zmin-function-alignment logic

This commit is contained in:
Folkert de Vries
2025-06-22 00:47:10 +02:00
parent 6d0c9e2a1c
commit a123a36a1f
4 changed files with 10 additions and 17 deletions

View File

@@ -126,6 +126,12 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
}
}
// Apply the minimum function alignment here, so that individual backends don't have to.
codegen_fn_attrs.alignment = Ord::max(
codegen_fn_attrs.alignment,
tcx.sess.opts.unstable_opts.min_function_alignment,
);
let Some(Ident { name, .. }) = attr.ident() else {
continue;
};