Skip to content

Commit 35deb5b

Browse files
compiler: Trim the misleading C from ExternAbi::CCmse*
1 parent a17780d commit 35deb5b

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ impl fmt::Display for CanonAbi {
6363
CanonAbi::Custom => ExternAbi::Custom,
6464
CanonAbi::Arm(arm_call) => match arm_call {
6565
ArmCall::Aapcs => ExternAbi::Aapcs { unwind: false },
66-
ArmCall::CCmseNonSecureCall => ExternAbi::CCmseNonSecureCall,
67-
ArmCall::CCmseNonSecureEntry => ExternAbi::CCmseNonSecureEntry,
66+
ArmCall::CCmseNonSecureCall => ExternAbi::CmseNonSecureCall,
67+
ArmCall::CCmseNonSecureEntry => ExternAbi::CmseNonSecureEntry,
6868
},
6969
CanonAbi::GpuKernel => ExternAbi::GpuKernel,
7070
CanonAbi::Interrupt(interrupt_kind) => match interrupt_kind {

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ pub enum ExternAbi {
5959
unwind: bool,
6060
},
6161
/// extremely constrained barely-C ABI for TrustZone
62-
CCmseNonSecureCall,
62+
CmseNonSecureCall,
6363
/// extremely constrained barely-C ABI for TrustZone
64-
CCmseNonSecureEntry,
64+
CmseNonSecureEntry,
6565

6666
/* gpu */
6767
/// An entry-point function called by the GPU's host
@@ -140,8 +140,6 @@ macro_rules! abi_impls {
140140
abi_impls! {
141141
ExternAbi = {
142142
C { unwind: false } =><= "C",
143-
CCmseNonSecureCall =><= "C-cmse-nonsecure-call",
144-
CCmseNonSecureEntry =><= "C-cmse-nonsecure-entry",
145143
C { unwind: true } =><= "C-unwind",
146144
Rust =><= "Rust",
147145
Aapcs { unwind: false } =><= "aapcs",
@@ -150,6 +148,8 @@ abi_impls! {
150148
AvrNonBlockingInterrupt =><= "avr-non-blocking-interrupt",
151149
Cdecl { unwind: false } =><= "cdecl",
152150
Cdecl { unwind: true } =><= "cdecl-unwind",
151+
CmseNonSecureCall =><= "cmse-nonsecure-call",
152+
CmseNonSecureEntry =><= "cmse-nonsecure-entry",
153153
Custom =><= "custom",
154154
EfiApi =><= "efiapi",
155155
Fastcall { unwind: false } =><= "fastcall",

compiler/rustc_ast_lowering/src/stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> {
127127
feature: sym::abi_riscv_interrupt,
128128
explain: GateReason::Experimental,
129129
}),
130-
ExternAbi::CCmseNonSecureCall => Err(UnstableAbi {
130+
ExternAbi::CmseNonSecureCall => Err(UnstableAbi {
131131
abi,
132132
feature: sym::abi_c_cmse_nonsecure_call,
133133
explain: GateReason::Experimental,
134134
}),
135-
ExternAbi::CCmseNonSecureEntry => Err(UnstableAbi {
135+
ExternAbi::CmseNonSecureEntry => Err(UnstableAbi {
136136
abi,
137137
feature: sym::cmse_nonsecure_entry,
138138
explain: GateReason::Experimental,

compiler/rustc_hir_analysis/src/hir_ty_lowering/cmse.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(crate) fn validate_cmse_abi<'tcx>(
1818
fn_sig: ty::PolyFnSig<'tcx>,
1919
) {
2020
match abi {
21-
ExternAbi::CCmseNonSecureCall => {
21+
ExternAbi::CmseNonSecureCall => {
2222
let hir_node = tcx.hir_node(hir_id);
2323
let hir::Node::Ty(hir::Ty {
2424
span: bare_fn_span,
@@ -78,7 +78,7 @@ pub(crate) fn validate_cmse_abi<'tcx>(
7878
}
7979
};
8080
}
81-
ExternAbi::CCmseNonSecureEntry => {
81+
ExternAbi::CmseNonSecureEntry => {
8282
let hir_node = tcx.hir_node(hir_id);
8383
let Some(hir::FnSig { decl, span: fn_sig_span, .. }) = hir_node.fn_sig() else {
8484
// 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
203203
match layout_err {
204204
TooGeneric(ty) => {
205205
match abi {
206-
ExternAbi::CCmseNonSecureCall => {
206+
ExternAbi::CmseNonSecureCall => {
207207
// prevent double reporting of this error
208208
!ty.is_impl_trait()
209209
}
210-
ExternAbi::CCmseNonSecureEntry => true,
210+
ExternAbi::CmseNonSecureEntry => true,
211211
_ => bug!("invalid ABI: {abi}"),
212212
}
213213
}

compiler/rustc_middle/src/ty/layout.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,13 +1248,13 @@ pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: ExternAbi)
12481248
| EfiApi
12491249
| AvrInterrupt
12501250
| AvrNonBlockingInterrupt
1251+
| CmseNonSecureCall
1252+
| CmseNonSecureEntry
1253+
| Custom
12511254
| RiscvInterruptM
12521255
| RiscvInterruptS
1253-
| CCmseNonSecureCall
1254-
| CCmseNonSecureEntry
1255-
| Custom
1256-
| Unadjusted
1257-
| RustInvalid => false,
1256+
| RustInvalid
1257+
| Unadjusted => false,
12581258
Rust | RustCall | RustCold => tcx.sess.panic_strategy() == PanicStrategy::Unwind,
12591259
}
12601260
}

compiler/rustc_smir/src/rustc_internal/internal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ impl RustcInternal for Abi {
479479
Abi::Vectorcall { unwind } => rustc_abi::ExternAbi::Vectorcall { unwind },
480480
Abi::Thiscall { unwind } => rustc_abi::ExternAbi::Thiscall { unwind },
481481
Abi::Aapcs { unwind } => rustc_abi::ExternAbi::Aapcs { unwind },
482+
Abi::CCmseNonSecureCall => rustc_abi::ExternAbi::CmseNonSecureCall,
483+
Abi::CCmseNonSecureEntry => rustc_abi::ExternAbi::CmseNonSecureEntry,
482484
Abi::Win64 { unwind } => rustc_abi::ExternAbi::Win64 { unwind },
483485
Abi::SysV64 { unwind } => rustc_abi::ExternAbi::SysV64 { unwind },
484486
Abi::PtxKernel => rustc_abi::ExternAbi::PtxKernel,
@@ -488,8 +490,6 @@ impl RustcInternal for Abi {
488490
Abi::EfiApi => rustc_abi::ExternAbi::EfiApi,
489491
Abi::AvrInterrupt => rustc_abi::ExternAbi::AvrInterrupt,
490492
Abi::AvrNonBlockingInterrupt => rustc_abi::ExternAbi::AvrNonBlockingInterrupt,
491-
Abi::CCmseNonSecureCall => rustc_abi::ExternAbi::CCmseNonSecureCall,
492-
Abi::CCmseNonSecureEntry => rustc_abi::ExternAbi::CCmseNonSecureEntry,
493493
Abi::System { unwind } => rustc_abi::ExternAbi::System { unwind },
494494
Abi::RustCall => rustc_abi::ExternAbi::RustCall,
495495
Abi::Unadjusted => rustc_abi::ExternAbi::Unadjusted,

compiler/rustc_smir/src/rustc_smir/convert/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,8 @@ impl<'tcx> Stable<'tcx> for rustc_abi::ExternAbi {
871871
ExternAbi::EfiApi => Abi::EfiApi,
872872
ExternAbi::AvrInterrupt => Abi::AvrInterrupt,
873873
ExternAbi::AvrNonBlockingInterrupt => Abi::AvrNonBlockingInterrupt,
874-
ExternAbi::CCmseNonSecureCall => Abi::CCmseNonSecureCall,
875-
ExternAbi::CCmseNonSecureEntry => Abi::CCmseNonSecureEntry,
874+
ExternAbi::CmseNonSecureCall => Abi::CCmseNonSecureCall,
875+
ExternAbi::CmseNonSecureEntry => Abi::CCmseNonSecureEntry,
876876
ExternAbi::System { unwind } => Abi::System { unwind },
877877
ExternAbi::RustCall => Abi::RustCall,
878878
ExternAbi::Unadjusted => Abi::Unadjusted,

compiler/rustc_target/src/spec/abi_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ impl AbiMap {
9393
(ExternAbi::Aapcs { .. }, Arch::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
9494
(ExternAbi::Aapcs { .. }, _) => return AbiMapping::Invalid,
9595

96-
(ExternAbi::CCmseNonSecureCall, Arch::Arm(ArmVer::ThumbV8M)) => {
96+
(ExternAbi::CmseNonSecureCall, Arch::Arm(ArmVer::ThumbV8M)) => {
9797
CanonAbi::Arm(ArmCall::CCmseNonSecureCall)
9898
}
99-
(ExternAbi::CCmseNonSecureEntry, Arch::Arm(ArmVer::ThumbV8M)) => {
99+
(ExternAbi::CmseNonSecureEntry, Arch::Arm(ArmVer::ThumbV8M)) => {
100100
CanonAbi::Arm(ArmCall::CCmseNonSecureEntry)
101101
}
102-
(ExternAbi::CCmseNonSecureCall | ExternAbi::CCmseNonSecureEntry, ..) => {
102+
(ExternAbi::CmseNonSecureCall | ExternAbi::CmseNonSecureEntry, ..) => {
103103
return AbiMapping::Invalid;
104104
}
105105

0 commit comments

Comments
 (0)