@@ -1939,24 +1939,6 @@ impl Arch {
19391939 }
19401940 }
19411941
1942- pub fn supports_c_variadic_definitions ( & self ) -> bool {
1943- use Arch :: * ;
1944-
1945- match self {
1946- // These targets just do not support c-variadic definitions.
1947- Bpf | SpirV => false ,
1948-
1949- // We don't know if the target supports c-variadic definitions, but we don't want
1950- // to needlessly restrict custom target.json configurations.
1951- Other ( _) => true ,
1952-
1953- AArch64 | AmdGpu | Arm | Arm64EC | Avr | CSky | Hexagon | LoongArch32 | LoongArch64
1954- | M68k | Mips | Mips32r6 | Mips64 | Mips64r6 | Msp430 | Nvptx64 | PowerPC
1955- | PowerPC64 | RiscV32 | RiscV64 | S390x | Sparc | Sparc64 | Wasm32 | Wasm64 | X86
1956- | X86_64 | Xtensa => true ,
1957- }
1958- }
1959-
19601942 /// Whether `#[rustc_scalable_vector]` is supported for a target architecture
19611943 pub fn supports_scalable_vectors ( & self ) -> bool {
19621944 use Arch :: * ;
@@ -2170,6 +2152,33 @@ impl Target {
21702152
21712153 Ok ( dl)
21722154 }
2155+
2156+ pub fn supports_c_variadic_definitions ( & self ) -> bool {
2157+ use Arch :: * ;
2158+
2159+ match self . arch {
2160+ // The c-variadic ABI for this target may change in the future, per this comment in
2161+ // clang:
2162+ //
2163+ // > To be compatible with GCC's behaviors, we force arguments with
2164+ // > 2×XLEN-bit alignment and size at most 2×XLEN bits like `long long`,
2165+ // > `unsigned long long` and `double` to have 4-byte alignment. This
2166+ // > behavior may be changed when RV32E/ILP32E is ratified.
2167+ RiscV32 if self . llvm_abiname == "ilp32e" => false ,
2168+
2169+ // These targets just do not support c-variadic definitions.
2170+ Bpf | SpirV => false ,
2171+
2172+ // We don't know how c-variadics work for this target. Using the default LLVM
2173+ // fallback implementation may work, but just to be safe we disallow this.
2174+ Other ( _) => false ,
2175+
2176+ AArch64 | AmdGpu | Arm | Arm64EC | Avr | CSky | Hexagon | LoongArch32 | LoongArch64
2177+ | M68k | Mips | Mips32r6 | Mips64 | Mips64r6 | Msp430 | Nvptx64 | PowerPC
2178+ | PowerPC64 | RiscV32 | RiscV64 | S390x | Sparc | Sparc64 | Wasm32 | Wasm64 | X86
2179+ | X86_64 | Xtensa => true ,
2180+ }
2181+ }
21732182}
21742183
21752184pub trait HasTargetSpec {
0 commit comments