Skip to content

Commit 65042d6

Browse files
committed
add extern "custom" functions
1 parent 98e21c8 commit 65042d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/abi.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,16 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
239239
pub fn conv_to_fn_attribute<'gcc>(conv: CanonAbi, arch: &str) -> Option<FnAttribute<'gcc>> {
240240
let attribute = match conv {
241241
CanonAbi::C | CanonAbi::Rust => return None,
242+
CanonAbi::RustCold => FnAttribute::Cold,
243+
// Functions with this calling convention can only be called from assembly, but it is
244+
// possible to declare an `extern "custom"` block, so the backend still needs a calling
245+
// convention for declaring foreign functions.
246+
CanonAbi::Custom => return None,
242247
CanonAbi::Arm(arm_call) => match arm_call {
243248
ArmCall::CCmseNonSecureCall => FnAttribute::ArmCmseNonsecureCall,
244249
ArmCall::CCmseNonSecureEntry => FnAttribute::ArmCmseNonsecureEntry,
245250
ArmCall::Aapcs => FnAttribute::ArmPcs("aapcs"),
246251
},
247-
CanonAbi::RustCold => FnAttribute::Cold,
248252
CanonAbi::GpuKernel => {
249253
if arch == "amdgpu" {
250254
FnAttribute::GcnAmdGpuHsaKernel

0 commit comments

Comments
 (0)