@@ -2917,54 +2917,6 @@ impl DerefMut for Target {
2917
2917
}
2918
2918
2919
2919
impl Target {
2920
- /// Given a function ABI, turn it into the correct ABI for this target.
2921
- pub fn adjust_abi ( & self , abi : ExternAbi , c_variadic : bool ) -> ExternAbi {
2922
- use ExternAbi :: * ;
2923
- match abi {
2924
- // On Windows, `extern "system"` behaves like msvc's `__stdcall`.
2925
- // `__stdcall` only applies on x86 and on non-variadic functions:
2926
- // https://learn.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-170
2927
- System { unwind } => {
2928
- if self . is_like_windows && self . arch == "x86" && !c_variadic {
2929
- Stdcall { unwind }
2930
- } else {
2931
- C { unwind }
2932
- }
2933
- }
2934
-
2935
- EfiApi => {
2936
- if self . arch == "arm" {
2937
- Aapcs { unwind : false }
2938
- } else if self . arch == "x86_64" {
2939
- Win64 { unwind : false }
2940
- } else {
2941
- C { unwind : false }
2942
- }
2943
- }
2944
-
2945
- // See commentary in `is_abi_supported`.
2946
- Stdcall { unwind } | Thiscall { unwind } | Fastcall { unwind } => {
2947
- if self . arch == "x86" { abi } else { C { unwind } }
2948
- }
2949
- Vectorcall { unwind } => {
2950
- if [ "x86" , "x86_64" ] . contains ( & & * self . arch ) {
2951
- abi
2952
- } else {
2953
- C { unwind }
2954
- }
2955
- }
2956
-
2957
- // The Windows x64 calling convention we use for `extern "Rust"`
2958
- // <https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions#register-volatility-and-preservation>
2959
- // expects the callee to save `xmm6` through `xmm15`, but `PreserveMost`
2960
- // (that we use by default for `extern "rust-cold"`) doesn't save any of those.
2961
- // So to avoid bloating callers, just use the Rust convention here.
2962
- RustCold if self . is_like_windows && self . arch == "x86_64" => Rust ,
2963
-
2964
- abi => abi,
2965
- }
2966
- }
2967
-
2968
2920
pub fn is_abi_supported ( & self , abi : ExternAbi ) -> bool {
2969
2921
use ExternAbi :: * ;
2970
2922
match abi {
0 commit comments