summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_target/src/spec/abi.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /compiler/rustc_target/src/spec/abi.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_target/src/spec/abi.rs')
-rw-r--r--compiler/rustc_target/src/spec/abi.rs46
1 files changed, 35 insertions, 11 deletions
diff --git a/compiler/rustc_target/src/spec/abi.rs b/compiler/rustc_target/src/spec/abi.rs
index 550cdf6bd..a99cccd42 100644
--- a/compiler/rustc_target/src/spec/abi.rs
+++ b/compiler/rustc_target/src/spec/abi.rs
@@ -14,15 +14,33 @@ pub enum Abi {
// hashing tests. These are used in many places, so giving them stable values reduces test
// churn. The specific values are meaningless.
Rust,
- C { unwind: bool },
- Cdecl { unwind: bool },
- Stdcall { unwind: bool },
- Fastcall { unwind: bool },
- Vectorcall { unwind: bool },
- Thiscall { unwind: bool },
- Aapcs { unwind: bool },
- Win64 { unwind: bool },
- SysV64 { unwind: bool },
+ C {
+ unwind: bool,
+ },
+ Cdecl {
+ unwind: bool,
+ },
+ Stdcall {
+ unwind: bool,
+ },
+ Fastcall {
+ unwind: bool,
+ },
+ Vectorcall {
+ unwind: bool,
+ },
+ Thiscall {
+ unwind: bool,
+ },
+ Aapcs {
+ unwind: bool,
+ },
+ Win64 {
+ unwind: bool,
+ },
+ SysV64 {
+ unwind: bool,
+ },
PtxKernel,
Msp430Interrupt,
X86Interrupt,
@@ -32,11 +50,16 @@ pub enum Abi {
AvrNonBlockingInterrupt,
CCmseNonSecureCall,
Wasm,
- System { unwind: bool },
+ System {
+ unwind: bool,
+ },
RustIntrinsic,
RustCall,
PlatformIntrinsic,
Unadjusted,
+ /// For things unlikely to be called, where reducing register pressure in
+ /// `extern "Rust"` callers is worth paying extra cost in the callee.
+ /// Stronger than just `#[cold]` because `fn` pointers might be incompatible.
RustCold,
RiscvInterruptM,
RiscvInterruptS,
@@ -45,7 +68,7 @@ pub enum Abi {
impl Abi {
pub fn supports_varargs(self) -> bool {
// * C and Cdecl obviously support varargs.
- // * C can be based on SysV64 or Win64, so they must support varargs.
+ // * C can be based on Aapcs, SysV64 or Win64, so they must support varargs.
// * EfiApi is based on Win64 or C, so it also supports it.
//
// * Stdcall does not, because it would be impossible for the callee to clean
@@ -56,6 +79,7 @@ impl Abi {
match self {
Self::C { .. }
| Self::Cdecl { .. }
+ | Self::Aapcs { .. }
| Self::Win64 { .. }
| Self::SysV64 { .. }
| Self::EfiApi => true,