Skip to content

Commit 6b6b842

Browse files
committed
remove cmse validation from rustc_codegen_ssa
it was moved to hir_analysis in the previous commit
1 parent 7b63734 commit 6b6b842

File tree

7 files changed

+4
-120
lines changed

7 files changed

+4
-120
lines changed

Diff for: compiler/rustc_codegen_ssa/messages.ftl

-12
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@ codegen_ssa_cgu_not_recorded =
1616
1717
codegen_ssa_check_installed_visual_studio = please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.
1818
19-
codegen_ssa_cmse_call_inputs_stack_spill =
20-
arguments for `C-cmse-nonsecure-call` function too large to pass via registers
21-
.label = this function uses the `C-cmse-nonsecure-call` ABI
22-
.call = but its arguments don't fit in the available registers
23-
.note = functions with the `C-cmse-nonsecure-call` ABI must pass all their arguments via the 4 32-bit available argument registers
24-
25-
codegen_ssa_cmse_call_output_stack_spill =
26-
return value of `C-cmse-nonsecure-call` function too large to pass via registers
27-
.label = this function uses the `C-cmse-nonsecure-call` ABI
28-
.call = but its return value doesn't fit in the available registers
29-
.note = functions with the `C-cmse-nonsecure-call` ABI must pass their result via the available return registers
30-
3119
codegen_ssa_compiler_builtins_cannot_call =
3220
`compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `{$caller}` to `{$callee}`
3321

Diff for: compiler/rustc_codegen_ssa/src/errors.rs

-22
Original file line numberDiff line numberDiff line change
@@ -1033,25 +1033,3 @@ pub struct CompilerBuiltinsCannotCall {
10331033
pub caller: String,
10341034
pub callee: String,
10351035
}
1036-
1037-
#[derive(Diagnostic)]
1038-
#[diag(codegen_ssa_cmse_call_inputs_stack_spill, code = E0798)]
1039-
#[note]
1040-
pub struct CmseCallInputsStackSpill {
1041-
#[primary_span]
1042-
#[label(codegen_ssa_call)]
1043-
pub call_site_span: Span,
1044-
#[label]
1045-
pub function_definition_span: Span,
1046-
}
1047-
1048-
#[derive(Diagnostic)]
1049-
#[diag(codegen_ssa_cmse_call_output_stack_spill, code = E0798)]
1050-
#[note]
1051-
pub struct CmseCallOutputStackSpill {
1052-
#[primary_span]
1053-
#[label(codegen_ssa_call)]
1054-
pub call_site_span: Span,
1055-
#[label]
1056-
pub function_definition_span: Span,
1057-
}

Diff for: compiler/rustc_codegen_ssa/src/mir/block.rs

-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::base;
77
use crate::common::{self, IntPredicate};
88
use crate::errors::CompilerBuiltinsCannotCall;
99
use crate::meth;
10-
use crate::mir::cmse;
1110
use crate::traits::*;
1211
use crate::MemFlags;
1312

@@ -870,9 +869,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
870869
let sig = callee.layout.ty.fn_sig(bx.tcx());
871870
let abi = sig.abi();
872871

873-
// emit errors if cmse ABI conditions are violated
874-
cmse::validate_cmse_abi(bx, &sig.skip_binder(), span, func.span(self.mir));
875-
876872
let extra_args = &args[sig.inputs().skip_binder().len()..];
877873
let extra_args = bx.tcx().mk_type_list_from_iter(extra_args.iter().map(|op_arg| {
878874
let op_ty = op_arg.node.ty(self.mir, bx.tcx());

Diff for: compiler/rustc_codegen_ssa/src/mir/cmse.rs

-72
This file was deleted.

Diff for: compiler/rustc_codegen_ssa/src/mir/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::iter;
1616

1717
mod analyze;
1818
mod block;
19-
mod cmse;
2019
pub mod constant;
2120
pub mod coverageinfo;
2221
pub mod debuginfo;

Diff for: compiler/rustc_hir_analysis/src/check/check.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1287,10 +1287,9 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
12871287
(span, trivial, check_non_exhaustive(tcx, ty).break_value())
12881288
});
12891289

1290-
let non_trivial_fields =
1291-
field_infos.clone().filter_map(
1292-
|(span, trivial, _non_exhaustive)| if !trivial { Some(span) } else { None },
1293-
);
1290+
let non_trivial_fields = field_infos
1291+
.clone()
1292+
.filter_map(|(span, trivial, _non_exhaustive)| if !trivial { Some(span) } else { None });
12941293
let non_trivial_count = non_trivial_fields.clone().count();
12951294
if non_trivial_count >= 2 {
12961295
bad_non_zero_sized_fields(

Diff for: compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1749,11 +1749,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
17491749
generic_segments.iter().map(|GenericPathSegment(_, index)| index).collect();
17501750
let _ = self.prohibit_generic_args(
17511751
path.segments.iter().enumerate().filter_map(|(index, seg)| {
1752-
if !indices.contains(&index) {
1753-
Some(seg)
1754-
} else {
1755-
None
1756-
}
1752+
if !indices.contains(&index) { Some(seg) } else { None }
17571753
}),
17581754
GenericsArgsErrExtend::DefVariant,
17591755
);

0 commit comments

Comments
 (0)