Skip to content

Commit ad5d698

Browse files
compiler: Trim the misleading C from ExternAbi::CCmse*
1 parent 36b2163 commit ad5d698

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
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
@@ -55,9 +55,9 @@ pub enum ExternAbi {
5555
unwind: bool,
5656
},
5757
/// extremely constrained barely-C ABI for TrustZone
58-
CCmseNonSecureCall,
58+
CmseNonSecureCall,
5959
/// extremely constrained barely-C ABI for TrustZone
60-
CCmseNonSecureEntry,
60+
CmseNonSecureEntry,
6161

6262
/* gpu */
6363
/// An entry-point function called by the GPU's host
@@ -136,8 +136,6 @@ macro_rules! abi_impls {
136136
abi_impls! {
137137
ExternAbi = {
138138
C { unwind: false } =><= "C",
139-
CCmseNonSecureCall =><= "C-cmse-nonsecure-call",
140-
CCmseNonSecureEntry =><= "C-cmse-nonsecure-entry",
141139
C { unwind: true } =><= "C-unwind",
142140
Rust =><= "Rust",
143141
Aapcs { unwind: false } =><= "aapcs",
@@ -146,6 +144,8 @@ abi_impls! {
146144
AvrNonBlockingInterrupt =><= "avr-non-blocking-interrupt",
147145
Cdecl { unwind: false } =><= "cdecl",
148146
Cdecl { unwind: true } =><= "cdecl-unwind",
147+
CmseNonSecureCall =><= "cmse-nonsecure-call",
148+
CmseNonSecureEntry =><= "cmse-nonsecure-entry",
149149
Custom =><= "custom",
150150
EfiApi =><= "efiapi",
151151
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
@@ -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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,11 +1248,11 @@ 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
12561256
| Unadjusted => false,
12571257
Rust | RustCall | RustCold => tcx.sess.panic_strategy() == PanicStrategy::Unwind,
12581258
}

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)