Add an attribute to check the number of lanes in a SIMD vector after monomorphization
Unify zero-length and oversized SIMD errors
This commit is contained in:
@@ -529,7 +529,10 @@ impl<'gcc, 'tcx> HasX86AbiOpt for CodegenCx<'gcc, 'tcx> {
|
||||
impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
|
||||
#[inline]
|
||||
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
|
||||
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
|
||||
if let LayoutError::SizeOverflow(_)
|
||||
| LayoutError::InvalidSimd { .. }
|
||||
| LayoutError::ReferencesError(_) = err
|
||||
{
|
||||
self.tcx.dcx().emit_fatal(respan(span, err.into_diagnostic()))
|
||||
} else {
|
||||
self.tcx.dcx().emit_fatal(ssa_errors::FailedToGetLayout { span, ty, err })
|
||||
@@ -545,7 +548,9 @@ impl<'gcc, 'tcx> FnAbiOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
|
||||
span: Span,
|
||||
fn_abi_request: FnAbiRequest<'tcx>,
|
||||
) -> ! {
|
||||
if let FnAbiError::Layout(LayoutError::SizeOverflow(_)) = err {
|
||||
if let FnAbiError::Layout(LayoutError::SizeOverflow(_) | LayoutError::InvalidSimd { .. }) =
|
||||
err
|
||||
{
|
||||
self.tcx.dcx().emit_fatal(respan(span, err))
|
||||
} else {
|
||||
match fn_abi_request {
|
||||
|
||||
Reference in New Issue
Block a user