@@ -42,6 +42,13 @@ pub enum ExternAbi {
4242 /// in a platform-agnostic way.
4343 RustInvalid ,
4444
45+ /// Preserves no registers.
46+ ///
47+ /// Note, that this ABI is not stable in the registers it uses, is intended as an optimization
48+ /// and may fall-back to a more conservative calling convention if the backend does not support
49+ /// forcing callers to save all registers.
50+ RustPreserveNone ,
51+
4552 /// Unstable impl detail that directly uses Rust types to describe the ABI to LLVM.
4653 /// Even normally-compatible Rust types can become ABI-incompatible with this ABI!
4754 Unadjusted ,
@@ -163,6 +170,7 @@ abi_impls! {
163170 RustCall =><= "rust-call" ,
164171 RustCold =><= "rust-cold" ,
165172 RustInvalid =><= "rust-invalid" ,
173+ RustPreserveNone =><= "rust-preserve-none" ,
166174 Stdcall { unwind: false } =><= "stdcall" ,
167175 Stdcall { unwind: true } =><= "stdcall-unwind" ,
168176 System { unwind: false } =><= "system" ,
@@ -243,7 +251,7 @@ impl ExternAbi {
243251 /// - are subject to change between compiler versions
244252 pub fn is_rustic_abi ( self ) -> bool {
245253 use ExternAbi :: * ;
246- matches ! ( self , Rust | RustCall | RustCold )
254+ matches ! ( self , Rust | RustCall | RustCold | RustPreserveNone )
247255 }
248256
249257 /// Returns whether the ABI supports C variadics. This only controls whether we allow *imports*
@@ -315,7 +323,8 @@ impl ExternAbi {
315323 | Self :: Thiscall { .. }
316324 | Self :: Vectorcall { .. }
317325 | Self :: SysV64 { .. }
318- | Self :: Win64 { .. } => true ,
326+ | Self :: Win64 { .. }
327+ | Self :: RustPreserveNone => true ,
319328 }
320329 }
321330}
0 commit comments