compiler: Trim the misleading C from ExternAbi::CCmse*
This commit is contained in:
@@ -63,8 +63,8 @@ impl fmt::Display for CanonAbi {
|
|||||||
CanonAbi::Custom => ExternAbi::Custom,
|
CanonAbi::Custom => ExternAbi::Custom,
|
||||||
CanonAbi::Arm(arm_call) => match arm_call {
|
CanonAbi::Arm(arm_call) => match arm_call {
|
||||||
ArmCall::Aapcs => ExternAbi::Aapcs { unwind: false },
|
ArmCall::Aapcs => ExternAbi::Aapcs { unwind: false },
|
||||||
ArmCall::CCmseNonSecureCall => ExternAbi::CCmseNonSecureCall,
|
ArmCall::CCmseNonSecureCall => ExternAbi::CmseNonSecureCall,
|
||||||
ArmCall::CCmseNonSecureEntry => ExternAbi::CCmseNonSecureEntry,
|
ArmCall::CCmseNonSecureEntry => ExternAbi::CmseNonSecureEntry,
|
||||||
},
|
},
|
||||||
CanonAbi::GpuKernel => ExternAbi::GpuKernel,
|
CanonAbi::GpuKernel => ExternAbi::GpuKernel,
|
||||||
CanonAbi::Interrupt(interrupt_kind) => match interrupt_kind {
|
CanonAbi::Interrupt(interrupt_kind) => match interrupt_kind {
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ pub enum ExternAbi {
|
|||||||
unwind: bool,
|
unwind: bool,
|
||||||
},
|
},
|
||||||
/// extremely constrained barely-C ABI for TrustZone
|
/// extremely constrained barely-C ABI for TrustZone
|
||||||
CCmseNonSecureCall,
|
CmseNonSecureCall,
|
||||||
/// extremely constrained barely-C ABI for TrustZone
|
/// extremely constrained barely-C ABI for TrustZone
|
||||||
CCmseNonSecureEntry,
|
CmseNonSecureEntry,
|
||||||
|
|
||||||
/* gpu */
|
/* gpu */
|
||||||
/// An entry-point function called by the GPU's host
|
/// An entry-point function called by the GPU's host
|
||||||
@@ -140,8 +140,6 @@ macro_rules! abi_impls {
|
|||||||
abi_impls! {
|
abi_impls! {
|
||||||
ExternAbi = {
|
ExternAbi = {
|
||||||
C { unwind: false } =><= "C",
|
C { unwind: false } =><= "C",
|
||||||
CCmseNonSecureCall =><= "C-cmse-nonsecure-call",
|
|
||||||
CCmseNonSecureEntry =><= "C-cmse-nonsecure-entry",
|
|
||||||
C { unwind: true } =><= "C-unwind",
|
C { unwind: true } =><= "C-unwind",
|
||||||
Rust =><= "Rust",
|
Rust =><= "Rust",
|
||||||
Aapcs { unwind: false } =><= "aapcs",
|
Aapcs { unwind: false } =><= "aapcs",
|
||||||
@@ -150,6 +148,8 @@ abi_impls! {
|
|||||||
AvrNonBlockingInterrupt =><= "avr-non-blocking-interrupt",
|
AvrNonBlockingInterrupt =><= "avr-non-blocking-interrupt",
|
||||||
Cdecl { unwind: false } =><= "cdecl",
|
Cdecl { unwind: false } =><= "cdecl",
|
||||||
Cdecl { unwind: true } =><= "cdecl-unwind",
|
Cdecl { unwind: true } =><= "cdecl-unwind",
|
||||||
|
CmseNonSecureCall =><= "cmse-nonsecure-call",
|
||||||
|
CmseNonSecureEntry =><= "cmse-nonsecure-entry",
|
||||||
Custom =><= "custom",
|
Custom =><= "custom",
|
||||||
EfiApi =><= "efiapi",
|
EfiApi =><= "efiapi",
|
||||||
Fastcall { unwind: false } =><= "fastcall",
|
Fastcall { unwind: false } =><= "fastcall",
|
||||||
|
|||||||
@@ -127,12 +127,12 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> {
|
|||||||
feature: sym::abi_riscv_interrupt,
|
feature: sym::abi_riscv_interrupt,
|
||||||
explain: GateReason::Experimental,
|
explain: GateReason::Experimental,
|
||||||
}),
|
}),
|
||||||
ExternAbi::CCmseNonSecureCall => Err(UnstableAbi {
|
ExternAbi::CmseNonSecureCall => Err(UnstableAbi {
|
||||||
abi,
|
abi,
|
||||||
feature: sym::abi_c_cmse_nonsecure_call,
|
feature: sym::abi_c_cmse_nonsecure_call,
|
||||||
explain: GateReason::Experimental,
|
explain: GateReason::Experimental,
|
||||||
}),
|
}),
|
||||||
ExternAbi::CCmseNonSecureEntry => Err(UnstableAbi {
|
ExternAbi::CmseNonSecureEntry => Err(UnstableAbi {
|
||||||
abi,
|
abi,
|
||||||
feature: sym::cmse_nonsecure_entry,
|
feature: sym::cmse_nonsecure_entry,
|
||||||
explain: GateReason::Experimental,
|
explain: GateReason::Experimental,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ pub(crate) fn validate_cmse_abi<'tcx>(
|
|||||||
fn_sig: ty::PolyFnSig<'tcx>,
|
fn_sig: ty::PolyFnSig<'tcx>,
|
||||||
) {
|
) {
|
||||||
match abi {
|
match abi {
|
||||||
ExternAbi::CCmseNonSecureCall => {
|
ExternAbi::CmseNonSecureCall => {
|
||||||
let hir_node = tcx.hir_node(hir_id);
|
let hir_node = tcx.hir_node(hir_id);
|
||||||
let hir::Node::Ty(hir::Ty {
|
let hir::Node::Ty(hir::Ty {
|
||||||
span: bare_fn_span,
|
span: bare_fn_span,
|
||||||
@@ -78,7 +78,7 @@ pub(crate) fn validate_cmse_abi<'tcx>(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
ExternAbi::CCmseNonSecureEntry => {
|
ExternAbi::CmseNonSecureEntry => {
|
||||||
let hir_node = tcx.hir_node(hir_id);
|
let hir_node = tcx.hir_node(hir_id);
|
||||||
let Some(hir::FnSig { decl, span: fn_sig_span, .. }) = hir_node.fn_sig() else {
|
let Some(hir::FnSig { decl, span: fn_sig_span, .. }) = hir_node.fn_sig() else {
|
||||||
// might happen when this ABI is used incorrectly. That will be handled elsewhere
|
// might happen when this ABI is used incorrectly. That will be handled elsewhere
|
||||||
@@ -203,11 +203,11 @@ fn should_emit_generic_error<'tcx>(abi: ExternAbi, layout_err: &'tcx LayoutError
|
|||||||
match layout_err {
|
match layout_err {
|
||||||
TooGeneric(ty) => {
|
TooGeneric(ty) => {
|
||||||
match abi {
|
match abi {
|
||||||
ExternAbi::CCmseNonSecureCall => {
|
ExternAbi::CmseNonSecureCall => {
|
||||||
// prevent double reporting of this error
|
// prevent double reporting of this error
|
||||||
!ty.is_impl_trait()
|
!ty.is_impl_trait()
|
||||||
}
|
}
|
||||||
ExternAbi::CCmseNonSecureEntry => true,
|
ExternAbi::CmseNonSecureEntry => true,
|
||||||
_ => bug!("invalid ABI: {abi}"),
|
_ => bug!("invalid ABI: {abi}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1248,13 +1248,13 @@ pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: ExternAbi)
|
|||||||
| EfiApi
|
| EfiApi
|
||||||
| AvrInterrupt
|
| AvrInterrupt
|
||||||
| AvrNonBlockingInterrupt
|
| AvrNonBlockingInterrupt
|
||||||
|
| CmseNonSecureCall
|
||||||
|
| CmseNonSecureEntry
|
||||||
|
| Custom
|
||||||
| RiscvInterruptM
|
| RiscvInterruptM
|
||||||
| RiscvInterruptS
|
| RiscvInterruptS
|
||||||
| CCmseNonSecureCall
|
| RustInvalid
|
||||||
| CCmseNonSecureEntry
|
| Unadjusted => false,
|
||||||
| Custom
|
|
||||||
| Unadjusted
|
|
||||||
| RustInvalid => false,
|
|
||||||
Rust | RustCall | RustCold => tcx.sess.panic_strategy() == PanicStrategy::Unwind,
|
Rust | RustCall | RustCold => tcx.sess.panic_strategy() == PanicStrategy::Unwind,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -479,6 +479,8 @@ impl RustcInternal for Abi {
|
|||||||
Abi::Vectorcall { unwind } => rustc_abi::ExternAbi::Vectorcall { unwind },
|
Abi::Vectorcall { unwind } => rustc_abi::ExternAbi::Vectorcall { unwind },
|
||||||
Abi::Thiscall { unwind } => rustc_abi::ExternAbi::Thiscall { unwind },
|
Abi::Thiscall { unwind } => rustc_abi::ExternAbi::Thiscall { unwind },
|
||||||
Abi::Aapcs { unwind } => rustc_abi::ExternAbi::Aapcs { unwind },
|
Abi::Aapcs { unwind } => rustc_abi::ExternAbi::Aapcs { unwind },
|
||||||
|
Abi::CCmseNonSecureCall => rustc_abi::ExternAbi::CmseNonSecureCall,
|
||||||
|
Abi::CCmseNonSecureEntry => rustc_abi::ExternAbi::CmseNonSecureEntry,
|
||||||
Abi::Win64 { unwind } => rustc_abi::ExternAbi::Win64 { unwind },
|
Abi::Win64 { unwind } => rustc_abi::ExternAbi::Win64 { unwind },
|
||||||
Abi::SysV64 { unwind } => rustc_abi::ExternAbi::SysV64 { unwind },
|
Abi::SysV64 { unwind } => rustc_abi::ExternAbi::SysV64 { unwind },
|
||||||
Abi::PtxKernel => rustc_abi::ExternAbi::PtxKernel,
|
Abi::PtxKernel => rustc_abi::ExternAbi::PtxKernel,
|
||||||
@@ -488,8 +490,6 @@ impl RustcInternal for Abi {
|
|||||||
Abi::EfiApi => rustc_abi::ExternAbi::EfiApi,
|
Abi::EfiApi => rustc_abi::ExternAbi::EfiApi,
|
||||||
Abi::AvrInterrupt => rustc_abi::ExternAbi::AvrInterrupt,
|
Abi::AvrInterrupt => rustc_abi::ExternAbi::AvrInterrupt,
|
||||||
Abi::AvrNonBlockingInterrupt => rustc_abi::ExternAbi::AvrNonBlockingInterrupt,
|
Abi::AvrNonBlockingInterrupt => rustc_abi::ExternAbi::AvrNonBlockingInterrupt,
|
||||||
Abi::CCmseNonSecureCall => rustc_abi::ExternAbi::CCmseNonSecureCall,
|
|
||||||
Abi::CCmseNonSecureEntry => rustc_abi::ExternAbi::CCmseNonSecureEntry,
|
|
||||||
Abi::System { unwind } => rustc_abi::ExternAbi::System { unwind },
|
Abi::System { unwind } => rustc_abi::ExternAbi::System { unwind },
|
||||||
Abi::RustCall => rustc_abi::ExternAbi::RustCall,
|
Abi::RustCall => rustc_abi::ExternAbi::RustCall,
|
||||||
Abi::Unadjusted => rustc_abi::ExternAbi::Unadjusted,
|
Abi::Unadjusted => rustc_abi::ExternAbi::Unadjusted,
|
||||||
|
|||||||
@@ -871,8 +871,8 @@ impl<'tcx> Stable<'tcx> for rustc_abi::ExternAbi {
|
|||||||
ExternAbi::EfiApi => Abi::EfiApi,
|
ExternAbi::EfiApi => Abi::EfiApi,
|
||||||
ExternAbi::AvrInterrupt => Abi::AvrInterrupt,
|
ExternAbi::AvrInterrupt => Abi::AvrInterrupt,
|
||||||
ExternAbi::AvrNonBlockingInterrupt => Abi::AvrNonBlockingInterrupt,
|
ExternAbi::AvrNonBlockingInterrupt => Abi::AvrNonBlockingInterrupt,
|
||||||
ExternAbi::CCmseNonSecureCall => Abi::CCmseNonSecureCall,
|
ExternAbi::CmseNonSecureCall => Abi::CCmseNonSecureCall,
|
||||||
ExternAbi::CCmseNonSecureEntry => Abi::CCmseNonSecureEntry,
|
ExternAbi::CmseNonSecureEntry => Abi::CCmseNonSecureEntry,
|
||||||
ExternAbi::System { unwind } => Abi::System { unwind },
|
ExternAbi::System { unwind } => Abi::System { unwind },
|
||||||
ExternAbi::RustCall => Abi::RustCall,
|
ExternAbi::RustCall => Abi::RustCall,
|
||||||
ExternAbi::Unadjusted => Abi::Unadjusted,
|
ExternAbi::Unadjusted => Abi::Unadjusted,
|
||||||
|
|||||||
@@ -93,13 +93,13 @@ impl AbiMap {
|
|||||||
(ExternAbi::Aapcs { .. }, Arch::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
|
(ExternAbi::Aapcs { .. }, Arch::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
|
||||||
(ExternAbi::Aapcs { .. }, _) => return AbiMapping::Invalid,
|
(ExternAbi::Aapcs { .. }, _) => return AbiMapping::Invalid,
|
||||||
|
|
||||||
(ExternAbi::CCmseNonSecureCall, Arch::Arm(ArmVer::ThumbV8M)) => {
|
(ExternAbi::CmseNonSecureCall, Arch::Arm(ArmVer::ThumbV8M)) => {
|
||||||
CanonAbi::Arm(ArmCall::CCmseNonSecureCall)
|
CanonAbi::Arm(ArmCall::CCmseNonSecureCall)
|
||||||
}
|
}
|
||||||
(ExternAbi::CCmseNonSecureEntry, Arch::Arm(ArmVer::ThumbV8M)) => {
|
(ExternAbi::CmseNonSecureEntry, Arch::Arm(ArmVer::ThumbV8M)) => {
|
||||||
CanonAbi::Arm(ArmCall::CCmseNonSecureEntry)
|
CanonAbi::Arm(ArmCall::CCmseNonSecureEntry)
|
||||||
}
|
}
|
||||||
(ExternAbi::CCmseNonSecureCall | ExternAbi::CCmseNonSecureEntry, ..) => {
|
(ExternAbi::CmseNonSecureCall | ExternAbi::CmseNonSecureEntry, ..) => {
|
||||||
return AbiMapping::Invalid;
|
return AbiMapping::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user