@@ -6,7 +6,7 @@ use rustc_macros::HashStable_Generic;
66use rustc_span:: Symbol ;
77
88use crate :: abi:: {
9- self , Abi , AddressSpace , Align , HasDataLayout , Pointer , Size , TyAbiInterface , TyAndLayout ,
9+ self , AddressSpace , Align , HasDataLayout , IrForm , Pointer , Size , TyAbiInterface , TyAndLayout ,
1010} ;
1111use crate :: spec:: abi:: Abi as SpecAbi ;
1212use crate :: spec:: { self , HasTargetSpec , HasWasmCAbiOpt , HasX86AbiOpt , WasmCAbi } ;
@@ -350,15 +350,15 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
350350 layout : TyAndLayout < ' a , Ty > ,
351351 scalar_attrs : impl Fn ( & TyAndLayout < ' a , Ty > , abi:: Scalar , Size ) -> ArgAttributes ,
352352 ) -> 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 (
357357 scalar_attrs ( & layout, a, Size :: ZERO ) ,
358358 scalar_attrs ( & layout, b, a. size ( cx) . align_to ( b. align ( cx) . abi ) ) ,
359359 ) ,
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) ,
362362 } ;
363363 ArgAbi { layout, mode }
364364 }
@@ -460,7 +460,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
460460
461461 pub fn extend_integer_width_to ( & mut self , bits : u64 ) {
462462 // Only integers have signedness
463- if let Abi :: Scalar ( scalar) = self . layout . abi {
463+ if let IrForm :: Scalar ( scalar) = self . layout . ir_form {
464464 if let abi:: Int ( i, signed) = scalar. primitive ( ) {
465465 if i. size ( ) . bits ( ) < bits {
466466 if let PassMode :: Direct ( ref mut attrs) = self . mode {
@@ -512,7 +512,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
512512 // That elevates any type difference to an ABI difference since we just use the
513513 // full Rust type as the LLVM argument/return type.
514514 if matches ! ( self . mode, PassMode :: Direct ( ..) )
515- && matches ! ( self . layout. abi , Abi :: Aggregate { .. } )
515+ && matches ! ( self . layout. ir_form , IrForm :: Memory { .. } )
516516 {
517517 // For aggregates in `Direct` mode to be compatible, the types need to be equal.
518518 self . layout . ty == other. layout . ty
@@ -791,8 +791,8 @@ impl<'a, Ty> FnAbi<'a, Ty> {
791791 continue ;
792792 }
793793
794- match arg. layout . abi {
795- Abi :: Aggregate { .. } => { }
794+ match arg. layout . ir_form {
795+ IrForm :: Memory { .. } => { }
796796
797797 // This is a fun case! The gist of what this is doing is
798798 // that we want callers and callees to always agree on the
@@ -813,7 +813,9 @@ impl<'a, Ty> FnAbi<'a, Ty> {
813813 // Note that the intrinsic ABI is exempt here as
814814 // that's how we connect up to LLVM and it's unstable
815815 // 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+ {
817819 arg. make_indirect ( ) ;
818820 continue ;
819821 }
0 commit comments