Skip to content

Commit

Permalink
remove cmse validation from rustc_codegen_ssa
Browse files Browse the repository at this point in the history
it was moved to hir_analysis in the previous commit
  • Loading branch information
folkertdev committed Jul 18, 2024
1 parent 7b63734 commit 6b6b842
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 120 deletions.
12 changes: 0 additions & 12 deletions compiler/rustc_codegen_ssa/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ codegen_ssa_cgu_not_recorded =
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.
codegen_ssa_cmse_call_inputs_stack_spill =
arguments for `C-cmse-nonsecure-call` function too large to pass via registers
.label = this function uses the `C-cmse-nonsecure-call` ABI
.call = but its arguments don't fit in the available registers
.note = functions with the `C-cmse-nonsecure-call` ABI must pass all their arguments via the 4 32-bit available argument registers
codegen_ssa_cmse_call_output_stack_spill =
return value of `C-cmse-nonsecure-call` function too large to pass via registers
.label = this function uses the `C-cmse-nonsecure-call` ABI
.call = but its return value doesn't fit in the available registers
.note = functions with the `C-cmse-nonsecure-call` ABI must pass their result via the available return registers
codegen_ssa_compiler_builtins_cannot_call =
`compiler_builtins` cannot call functions through upstream monomorphizations; encountered invalid call from `{$caller}` to `{$callee}`
Expand Down
22 changes: 0 additions & 22 deletions compiler/rustc_codegen_ssa/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,25 +1033,3 @@ pub struct CompilerBuiltinsCannotCall {
pub caller: String,
pub callee: String,
}

#[derive(Diagnostic)]
#[diag(codegen_ssa_cmse_call_inputs_stack_spill, code = E0798)]
#[note]
pub struct CmseCallInputsStackSpill {
#[primary_span]
#[label(codegen_ssa_call)]
pub call_site_span: Span,
#[label]
pub function_definition_span: Span,
}

#[derive(Diagnostic)]
#[diag(codegen_ssa_cmse_call_output_stack_spill, code = E0798)]
#[note]
pub struct CmseCallOutputStackSpill {
#[primary_span]
#[label(codegen_ssa_call)]
pub call_site_span: Span,
#[label]
pub function_definition_span: Span,
}
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::base;
use crate::common::{self, IntPredicate};
use crate::errors::CompilerBuiltinsCannotCall;
use crate::meth;
use crate::mir::cmse;
use crate::traits::*;
use crate::MemFlags;

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

// emit errors if cmse ABI conditions are violated
cmse::validate_cmse_abi(bx, &sig.skip_binder(), span, func.span(self.mir));

let extra_args = &args[sig.inputs().skip_binder().len()..];
let extra_args = bx.tcx().mk_type_list_from_iter(extra_args.iter().map(|op_arg| {
let op_ty = op_arg.node.ty(self.mir, bx.tcx());
Expand Down
72 changes: 0 additions & 72 deletions compiler/rustc_codegen_ssa/src/mir/cmse.rs

This file was deleted.

1 change: 0 additions & 1 deletion compiler/rustc_codegen_ssa/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use std::iter;

mod analyze;
mod block;
mod cmse;
pub mod constant;
pub mod coverageinfo;
pub mod debuginfo;
Expand Down
7 changes: 3 additions & 4 deletions compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,10 +1287,9 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
(span, trivial, check_non_exhaustive(tcx, ty).break_value())
});

let non_trivial_fields =
field_infos.clone().filter_map(
|(span, trivial, _non_exhaustive)| if !trivial { Some(span) } else { None },
);
let non_trivial_fields = field_infos
.clone()
.filter_map(|(span, trivial, _non_exhaustive)| if !trivial { Some(span) } else { None });
let non_trivial_count = non_trivial_fields.clone().count();
if non_trivial_count >= 2 {
bad_non_zero_sized_fields(
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1749,11 +1749,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
generic_segments.iter().map(|GenericPathSegment(_, index)| index).collect();
let _ = self.prohibit_generic_args(
path.segments.iter().enumerate().filter_map(|(index, seg)| {
if !indices.contains(&index) {
Some(seg)
} else {
None
}
if !indices.contains(&index) { Some(seg) } else { None }
}),
GenericsArgsErrExtend::DefVariant,
);
Expand Down

0 comments on commit 6b6b842

Please sign in to comment.