@@ -6,7 +6,7 @@ use rustc_macros::HashStable_Generic;
6
6
use rustc_span:: Symbol ;
7
7
8
8
use crate :: abi:: {
9
- self , Abi , AddressSpace , Align , HasDataLayout , Pointer , Size , TyAbiInterface , TyAndLayout ,
9
+ self , AddressSpace , Align , HasDataLayout , IrForm , Pointer , Size , TyAbiInterface , TyAndLayout ,
10
10
} ;
11
11
use crate :: spec:: abi:: Abi as SpecAbi ;
12
12
use crate :: spec:: { self , HasTargetSpec , HasWasmCAbiOpt , HasX86AbiOpt , WasmCAbi } ;
@@ -350,15 +350,15 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
350
350
layout : TyAndLayout < ' a , Ty > ,
351
351
scalar_attrs : impl Fn ( & TyAndLayout < ' a , Ty > , abi:: Scalar , Size ) -> ArgAttributes ,
352
352
) -> Self {
353
- let mode = match layout. abi {
354
- Abi :: Uninhabited => PassMode :: Ignore ,
355
- Abi :: Scalar ( scalar) => PassMode :: Direct ( scalar_attrs ( & layout, scalar, Size :: ZERO ) ) ,
356
- Abi :: ScalarPair ( a, b) => PassMode :: Pair (
353
+ let mode = match layout. ir_form {
354
+ IrForm :: Uninhabited => PassMode :: Ignore ,
355
+ IrForm :: Scalar ( scalar) => PassMode :: Direct ( scalar_attrs ( & layout, scalar, Size :: ZERO ) ) ,
356
+ IrForm :: ScalarPair ( a, b) => PassMode :: Pair (
357
357
scalar_attrs ( & layout, a, Size :: ZERO ) ,
358
358
scalar_attrs ( & layout, b, a. size ( cx) . align_to ( b. align ( cx) . abi ) ) ,
359
359
) ,
360
- Abi :: Vector { .. } => PassMode :: Direct ( ArgAttributes :: new ( ) ) ,
361
- Abi :: Aggregate { .. } => Self :: indirect_pass_mode ( & layout) ,
360
+ IrForm :: Vector { .. } => PassMode :: Direct ( ArgAttributes :: new ( ) ) ,
361
+ IrForm :: Memory { .. } => Self :: indirect_pass_mode ( & layout) ,
362
362
} ;
363
363
ArgAbi { layout, mode }
364
364
}
@@ -460,7 +460,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
460
460
461
461
pub fn extend_integer_width_to ( & mut self , bits : u64 ) {
462
462
// Only integers have signedness
463
- if let Abi :: Scalar ( scalar) = self . layout . abi {
463
+ if let IrForm :: Scalar ( scalar) = self . layout . ir_form {
464
464
if let abi:: Int ( i, signed) = scalar. primitive ( ) {
465
465
if i. size ( ) . bits ( ) < bits {
466
466
if let PassMode :: Direct ( ref mut attrs) = self . mode {
@@ -512,7 +512,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
512
512
// That elevates any type difference to an ABI difference since we just use the
513
513
// full Rust type as the LLVM argument/return type.
514
514
if matches ! ( self . mode, PassMode :: Direct ( ..) )
515
- && matches ! ( self . layout. abi , Abi :: Aggregate { .. } )
515
+ && matches ! ( self . layout. ir_form , IrForm :: Memory { .. } )
516
516
{
517
517
// For aggregates in `Direct` mode to be compatible, the types need to be equal.
518
518
self . layout . ty == other. layout . ty
@@ -791,8 +791,8 @@ impl<'a, Ty> FnAbi<'a, Ty> {
791
791
continue ;
792
792
}
793
793
794
- match arg. layout . abi {
795
- Abi :: Aggregate { .. } => { }
794
+ match arg. layout . ir_form {
795
+ IrForm :: Memory { .. } => { }
796
796
797
797
// This is a fun case! The gist of what this is doing is
798
798
// that we want callers and callees to always agree on the
@@ -813,7 +813,9 @@ impl<'a, Ty> FnAbi<'a, Ty> {
813
813
// Note that the intrinsic ABI is exempt here as
814
814
// that's how we connect up to LLVM and it's unstable
815
815
// anyway, we control all calls to it in libstd.
816
- Abi :: Vector { .. } if abi != SpecAbi :: RustIntrinsic && spec. simd_types_indirect => {
816
+ IrForm :: Vector { .. }
817
+ if abi != SpecAbi :: RustIntrinsic && spec. simd_types_indirect =>
818
+ {
817
819
arg. make_indirect ( ) ;
818
820
continue ;
819
821
}
0 commit comments