rustc_hir_analysis::hir_ty_lowering::cmse

Function validate_cmse_abi

Source
pub(crate) fn validate_cmse_abi<'tcx>(
    tcx: TyCtxt<'tcx>,
    dcx: DiagCtxtHandle<'_>,
    hir_id: HirId,
    abi: ExternAbi,
    fn_sig: PolyFnSig<'tcx>,
)
Expand description

Check conditions on inputs and outputs that the cmse ABIs impose: arguments and results MUST be returned via registers (i.e. MUST NOT spill to the stack). LLVM will also validate these conditions, but by checking them here rustc can emit nicer error messages.