diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2022-02-01 18:53:45 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2022-02-02 22:21:24 +0100 |
| commit | 547b4e601e797e7989f6fc9ebe921376c74bd1f0 (patch) | |
| tree | 35c1c18a01a0bde17cc6a20abcf635f12853e75e /compiler/rustc_target/src/abi | |
| parent | 498eeb72f590e518e19746b346be53713689e207 (diff) | |
| download | rust-547b4e601e797e7989f6fc9ebe921376c74bd1f0.tar.gz rust-547b4e601e797e7989f6fc9ebe921376c74bd1f0.zip | |
Add more *-unwind ABI variants
The following *-unwind ABIs are now supported: - "C-unwind" - "cdecl-unwind" - "stdcall-unwind" - "fastcall-unwind" - "vectorcall-unwind" - "thiscall-unwind" - "aapcs-unwind" - "win64-unwind" - "sysv64-unwind" - "system-unwind"
Diffstat (limited to 'compiler/rustc_target/src/abi')
| -rw-r--r-- | compiler/rustc_target/src/abi/call/mod.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index 735b7e76e38..43eb7ab05e0 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -658,22 +658,24 @@ impl<'a, Ty> FnAbi<'a, Ty> { match &cx.target_spec().arch[..] { "x86" => { - let flavor = if abi == spec::abi::Abi::Fastcall { + let flavor = if let spec::abi::Abi::Fastcall { .. } = abi { x86::Flavor::Fastcall } else { x86::Flavor::General }; x86::compute_abi_info(cx, self, flavor); } - "x86_64" => { - if abi == spec::abi::Abi::SysV64 { - x86_64::compute_abi_info(cx, self); - } else if abi == spec::abi::Abi::Win64 || cx.target_spec().is_like_windows { - x86_win64::compute_abi_info(self); - } else { - x86_64::compute_abi_info(cx, self); + "x86_64" => match abi { + spec::abi::Abi::SysV64 { .. } => x86_64::compute_abi_info(cx, self), + spec::abi::Abi::Win64 { .. } => x86_win64::compute_abi_info(self), + _ => { + if cx.target_spec().is_like_windows { + x86_win64::compute_abi_info(self) + } else { + x86_64::compute_abi_info(cx, self) + } } - } + }, "aarch64" => aarch64::compute_abi_info(cx, self), "amdgpu" => amdgpu::compute_abi_info(cx, self), "arm" => arm::compute_abi_info(cx, self), |
