diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2025-06-22 00:47:10 +0200 | 
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2025-06-22 00:47:10 +0200 | 
| commit | a123a36a1f52fa8ac85bfa1ba4cef7062058db7b (patch) | |
| tree | 4841afb63c3ca842b4da06ca70a12b564b9cdeec /compiler/rustc_codegen_ssa/src/codegen_attrs.rs | |
| parent | 6d0c9e2a1c80e350c50f5fb9338ea9e585ec603b (diff) | |
| download | rust-a123a36a1f52fa8ac85bfa1ba4cef7062058db7b.tar.gz rust-a123a36a1f52fa8ac85bfa1ba4cef7062058db7b.zip | |
centralize `-Zmin-function-alignment` logic
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/codegen_attrs.rs')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/codegen_attrs.rs | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs index 39818be5bde..ce83bd62ddd 100644 --- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs +++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs @@ -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; }; | 
