Rollup merge of #127605 - nikic:remove-extern-wasm, r=oli-obk · rust-lang/rust@fa3ce50 (original) (raw)
1
1
`use crate::abi::{self, Abi, Align, FieldsShape, Size};
`
2
2
`use crate::abi::{HasDataLayout, TyAbiInterface, TyAndLayout};
`
3
``
`-
use crate::spec::{self, HasTargetSpec, HasWasmCAbiOpt};
`
``
3
`+
use crate::spec::{self, HasTargetSpec, HasWasmCAbiOpt, WasmCAbi};
`
4
4
`use rustc_macros::HashStable_Generic;
`
5
5
`use rustc_span::Symbol;
`
6
6
`use std::fmt;
`
`@@ -854,7 +854,8 @@ impl<'a, Ty> FnAbi<'a, Ty> {
`
854
854
`return Ok(());
`
855
855
`}
`
856
856
``
857
``
`-
match &cx.target_spec().arch[..] {
`
``
857
`+
let spec = cx.target_spec();
`
``
858
`+
match &spec.arch[..] {
`
858
859
`"x86" => {
`
859
860
`let flavor = if let spec::abi::Abi::Fastcall { .. }
`
860
861
` | spec::abi::Abi::Vectorcall { .. } = abi
`
`@@ -901,9 +902,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
`
901
902
`"sparc" => sparc::compute_abi_info(cx, self),
`
902
903
`"sparc64" => sparc64::compute_abi_info(cx, self),
`
903
904
`"nvptx64" => {
`
904
``
`-
if cx.target_spec().adjust_abi(cx, abi, self.c_variadic)
`
905
``
`-
== spec::abi::Abi::PtxKernel
`
906
``
`-
{
`
``
905
`+
if cx.target_spec().adjust_abi(abi, self.c_variadic) == spec::abi::Abi::PtxKernel {
`
907
906
` nvptx64::compute_ptx_kernel_abi_info(cx, self)
`
908
907
`} else {
`
909
908
` nvptx64::compute_abi_info(self)
`
`@@ -912,13 +911,14 @@ impl<'a, Ty> FnAbi<'a, Ty> {
`
912
911
`"hexagon" => hexagon::compute_abi_info(self),
`
913
912
`"xtensa" => xtensa::compute_abi_info(cx, self),
`
914
913
`"riscv32" | "riscv64" => riscv::compute_abi_info(cx, self),
`
915
``
`-
"wasm32" | "wasm64" => {
`
916
``
`-
if cx.target_spec().adjust_abi(cx, abi, self.c_variadic) == spec::abi::Abi::Wasm {
`
``
914
`+
"wasm32" => {
`
``
915
`+
if spec.os == "unknown" && cx.wasm_c_abi_opt() == WasmCAbi::Legacy {
`
917
916
` wasm::compute_wasm_abi_info(self)
`
918
917
`} else {
`
919
918
` wasm::compute_c_abi_info(cx, self)
`
920
919
`}
`
921
920
`}
`
``
921
`+
"wasm64" => wasm::compute_c_abi_info(cx, self),
`
922
922
`"bpf" => bpf::compute_abi_info(self),
`
923
923
` arch => {
`
924
924
`return Err(AdjustForForeignAbiError::Unsupported {
`