diff options
| author | Soveu <marx.tomasz@gmail.com> | 2023-09-14 23:21:39 +0200 |
|---|---|---|
| committer | Soveu <marx.tomasz@gmail.com> | 2023-09-14 23:21:39 +0200 |
| commit | eea6149e03401c4a94a213112fb0694e3f44991b (patch) | |
| tree | 49ac7b17f3d237867f26a7c3ef579eee34b97697 /compiler | |
| parent | ccf817b9bbe449204a227430d0a84a4f1d1798cc (diff) | |
Enable varargs support for AAPCS calling convention
This is the default calling convention for ARM - it is used for extern "C", therefore it supports varargs.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/abi.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index b0f333b79ca..ef788935efb 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -117,7 +117,7 @@ use rustc_hir::def::DefKind; fluent_messages! { "../messages.ftl" } fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: Abi, span: Span) { - const CONVENTIONS_UNSTABLE: &str = "`C`, `cdecl`, `win64`, `sysv64` or `efiapi`"; + const CONVENTIONS_UNSTABLE: &str = "`C`, `cdecl`, `aapcs`, `win64`, `sysv64` or `efiapi`"; const CONVENTIONS_STABLE: &str = "`C` or `cdecl`"; const UNSTABLE_EXPLAIN: &str = "using calling conventions other than `C` or `cdecl` for varargs functions is unstable"; diff --git a/compiler/rustc_target/src/spec/abi.rs b/compiler/rustc_target/src/spec/abi.rs index 956a5cb5c2f..a99cccd42c4 100644 --- a/compiler/rustc_target/src/spec/abi.rs +++ b/compiler/rustc_target/src/spec/abi.rs @@ -68,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 @@ -79,6 +79,7 @@ impl Abi { match self { Self::C { .. } | Self::Cdecl { .. } + | Self::Aapcs { .. } | Self::Win64 { .. } | Self::SysV64 { .. } | Self::EfiApi => true, |
