Skip to content

Commit 65420b5

Browse files
compiler: Trim the misleading C from ExternAbi::CCmse*
1 parent 14863ea commit 65420b5

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ impl fmt::Display for CanonAbi {
5959
CanonAbi::RustCold => ExternAbi::RustCold,
6060
CanonAbi::Arm(arm_call) => match arm_call {
6161
ArmCall::Aapcs => ExternAbi::Aapcs { unwind: false },
62-
ArmCall::CCmseNonSecureCall => ExternAbi::CCmseNonSecureCall,
63-
ArmCall::CCmseNonSecureEntry => ExternAbi::CCmseNonSecureEntry,
62+
ArmCall::CCmseNonSecureCall => ExternAbi::CmseNonSecureCall,
63+
ArmCall::CCmseNonSecureEntry => ExternAbi::CmseNonSecureEntry,
6464
},
6565
CanonAbi::GpuKernel => ExternAbi::GpuKernel,
6666
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
@@ -50,9 +50,9 @@ pub enum ExternAbi {
5050
unwind: bool,
5151
},
5252
/// extremely constrained barely-C ABI for TrustZone
53-
CCmseNonSecureCall,
53+
CmseNonSecureCall,
5454
/// extremely constrained barely-C ABI for TrustZone
55-
CCmseNonSecureEntry,
55+
CmseNonSecureEntry,
5656

5757
/* gpu */
5858
/// An entry-point function called by the GPU's host
@@ -131,8 +131,6 @@ macro_rules! abi_impls {
131131
abi_impls! {
132132
ExternAbi = {
133133
C { unwind: false } =><= "C",
134-
CCmseNonSecureCall =><= "C-cmse-nonsecure-call",
135-
CCmseNonSecureEntry =><= "C-cmse-nonsecure-entry",
136134
C { unwind: true } =><= "C-unwind",
137135
Rust =><= "Rust",
138136
Aapcs { unwind: false } =><= "aapcs",
@@ -141,6 +139,8 @@ abi_impls! {
141139
AvrNonBlockingInterrupt =><= "avr-non-blocking-interrupt",
142140
Cdecl { unwind: false } =><= "cdecl",
143141
Cdecl { unwind: true } =><= "cdecl-unwind",
142+
CmseNonSecureCall =><= "cmse-nonsecure-call",
143+
CmseNonSecureEntry =><= "cmse-nonsecure-entry",
144144
EfiApi =><= "efiapi",
145145
Fastcall { unwind: false } =><= "fastcall",
146146
Fastcall { unwind: true } =><= "fastcall-unwind",

compiler/rustc_ast_lowering/src/stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> {
124124
feature: sym::abi_riscv_interrupt,
125125
explain: GateReason::Experimental,
126126
}),
127-
ExternAbi::CCmseNonSecureCall => Err(UnstableAbi {
127+
ExternAbi::CmseNonSecureCall => Err(UnstableAbi {
128128
abi,
129129
feature: sym::abi_c_cmse_nonsecure_call,
130130
explain: GateReason::Experimental,
131131
}),
132-
ExternAbi::CCmseNonSecureEntry => Err(UnstableAbi {
132+
ExternAbi::CmseNonSecureEntry => Err(UnstableAbi {
133133
abi,
134134
feature: sym::cmse_nonsecure_entry,
135135
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,10 +1262,10 @@ pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: ExternAbi)
12621262
| EfiApi
12631263
| AvrInterrupt
12641264
| AvrNonBlockingInterrupt
1265+
| CmseNonSecureCall
1266+
| CmseNonSecureEntry
12651267
| RiscvInterruptM
12661268
| RiscvInterruptS
1267-
| CCmseNonSecureCall
1268-
| CCmseNonSecureEntry
12691269
| Unadjusted => false,
12701270
Rust | RustCall | RustCold => tcx.sess.panic_strategy() == PanicStrategy::Unwind,
12711271
}

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
@@ -85,13 +85,13 @@ impl AbiMap {
8585
(ExternAbi::Aapcs { .. }, Arch::Arm(..)) => CanonAbi::Arm(ArmCall::Aapcs),
8686
(ExternAbi::Aapcs { .. }, _) => return AbiMapping::Invalid,
8787

88-
(ExternAbi::CCmseNonSecureCall, Arch::Arm(ArmVer::ThumbV8M)) => {
88+
(ExternAbi::CmseNonSecureCall, Arch::Arm(ArmVer::ThumbV8M)) => {
8989
CanonAbi::Arm(ArmCall::CCmseNonSecureCall)
9090
}
91-
(ExternAbi::CCmseNonSecureEntry, Arch::Arm(ArmVer::ThumbV8M)) => {
91+
(ExternAbi::CmseNonSecureEntry, Arch::Arm(ArmVer::ThumbV8M)) => {
9292
CanonAbi::Arm(ArmCall::CCmseNonSecureEntry)
9393
}
94-
(ExternAbi::CCmseNonSecureCall | ExternAbi::CCmseNonSecureEntry, ..) => {
94+
(ExternAbi::CmseNonSecureCall | ExternAbi::CmseNonSecureEntry, ..) => {
9595
return AbiMapping::Invalid;
9696
}
9797

0 commit comments

Comments
 (0)