From e90be842fb9129aa27e5b6412f245ca39999f9f1 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sun, 29 May 2022 00:25:14 -0700 Subject: Add support for emitting functions with `coldcc` in LLVM The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps. --- compiler/rustc_target/src/spec/abi.rs | 3 +++ compiler/rustc_target/src/spec/mod.rs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_target/src/spec') diff --git a/compiler/rustc_target/src/spec/abi.rs b/compiler/rustc_target/src/spec/abi.rs index d9e571c72e5..337554dc96e 100644 --- a/compiler/rustc_target/src/spec/abi.rs +++ b/compiler/rustc_target/src/spec/abi.rs @@ -35,6 +35,7 @@ pub enum Abi { RustCall, PlatformIntrinsic, Unadjusted, + RustCold, } #[derive(Copy, Clone)] @@ -81,6 +82,7 @@ const AbiDatas: &[AbiData] = &[ AbiData { abi: Abi::RustCall, name: "rust-call" }, AbiData { abi: Abi::PlatformIntrinsic, name: "platform-intrinsic" }, AbiData { abi: Abi::Unadjusted, name: "unadjusted" }, + AbiData { abi: Abi::RustCold, name: "rust-cold" }, ]; /// Returns the ABI with the given name (if any). @@ -139,6 +141,7 @@ impl Abi { RustCall => 31, PlatformIntrinsic => 32, Unadjusted => 33, + RustCold => 34, }; debug_assert!( AbiDatas diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 6dd245b047c..866cd5f0fe7 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1618,7 +1618,8 @@ impl Target { | PlatformIntrinsic | Unadjusted | Cdecl { .. } - | EfiApi => true, + | EfiApi + | RustCold => true, X86Interrupt => ["x86", "x86_64"].contains(&&self.arch[..]), Aapcs { .. } => "arm" == self.arch, CCmseNonSecureCall => ["arm", "aarch64"].contains(&&self.arch[..]), -- cgit 1.4.1-3-g733a5