diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-06-14 09:37:32 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-06-14 09:37:32 +0000 |
| commit | 2f2a0b9fc8d858277dd5e39de33efa14b4b6d511 (patch) | |
| tree | a1f6b87dfb7a9653566c89f9281ceb8d14684515 /src | |
| parent | 9594d67bcf88c82546f8fae1382a06a239cddbe9 (diff) | |
| parent | 393e46edab3dbf2fe746e1e8ad051bd8ba6e38ef (diff) | |
| download | rust-2f2a0b9fc8d858277dd5e39de33efa14b4b6d511.tar.gz rust-2f2a0b9fc8d858277dd5e39de33efa14b4b6d511.zip | |
Sync from rust 8da623945f83933dd38644d5745532ee032e855b
Diffstat (limited to 'src')
| -rw-r--r-- | src/abi/mod.rs | 5 | ||||
| -rw-r--r-- | src/intrinsics/mod.rs | 4 | ||||
| -rw-r--r-- | src/unsize.rs | 2 | ||||
| -rw-r--r-- | src/vtable.rs | 2 |
4 files changed, 9 insertions, 4 deletions
diff --git a/src/abi/mod.rs b/src/abi/mod.rs index fe5b220117f..4c6fd907815 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -51,6 +51,11 @@ pub(crate) fn conv_to_call_conv( CanonAbi::Rust | CanonAbi::C => default_call_conv, CanonAbi::RustCold => CallConv::Cold, + // Functions with this calling convention can only be called from assembly, but it is + // possible to declare an `extern "custom"` block, so the backend still needs a calling + // convention for declaring foreign functions. + CanonAbi::Custom => default_call_conv, + CanonAbi::X86(x86_call) => match x86_call { X86Call::SysV64 => CallConv::SystemV, X86Call::Win64 => CallConv::WindowsFastcall, diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 1d1cf884e48..df5748c34d1 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -586,7 +586,7 @@ fn codegen_regular_intrinsic_call<'tcx>( let (size, _align) = crate::unsize::size_and_align_of(fx, layout, meta); ret.write_cvalue(fx, CValue::by_val(size, usize_layout)); } - sym::min_align_of_val => { + sym::align_of_val => { intrinsic_args!(fx, args => (ptr); intrinsic); let layout = fx.layout_of(generic_args.type_at(0)); @@ -613,7 +613,7 @@ fn codegen_regular_intrinsic_call<'tcx>( intrinsic_args!(fx, args => (vtable); intrinsic); let vtable = vtable.load_scalar(fx); - let align = crate::vtable::min_align_of_obj(fx, vtable); + let align = crate::vtable::align_of_obj(fx, vtable); ret.write_cvalue(fx, CValue::by_val(align, usize_layout)); } diff --git a/src/unsize.rs b/src/unsize.rs index 662546e4999..df60b05c463 100644 --- a/src/unsize.rs +++ b/src/unsize.rs @@ -212,7 +212,7 @@ pub(crate) fn size_and_align_of<'tcx>( // load size/align from vtable ( crate::vtable::size_of_obj(fx, info.unwrap()), - crate::vtable::min_align_of_obj(fx, info.unwrap()), + crate::vtable::align_of_obj(fx, info.unwrap()), ) } ty::Slice(_) | ty::Str => { diff --git a/src/vtable.rs b/src/vtable.rs index 05a8e3c3342..1fae56949bc 100644 --- a/src/vtable.rs +++ b/src/vtable.rs @@ -31,7 +31,7 @@ pub(crate) fn size_of_obj(fx: &mut FunctionCx<'_, '_, '_>, vtable: Value) -> Val ) } -pub(crate) fn min_align_of_obj(fx: &mut FunctionCx<'_, '_, '_>, vtable: Value) -> Value { +pub(crate) fn align_of_obj(fx: &mut FunctionCx<'_, '_, '_>, vtable: Value) -> Value { let usize_size = fx.layout_of(fx.tcx.types.usize).size.bytes() as usize; fx.bcx.ins().load( fx.pointer_type, |
