@@ -4,7 +4,7 @@ use std::fmt;
44use arrayvec:: ArrayVec ;
55use either:: Either ;
66use rustc_abi as abi;
7- use rustc_abi:: { Abi , Align , Size } ;
7+ use rustc_abi:: { Align , IrForm , Size } ;
88use rustc_middle:: bug;
99use rustc_middle:: mir:: interpret:: { Pointer , Scalar , alloc_range} ;
1010use rustc_middle:: mir:: { self , ConstValue } ;
@@ -163,15 +163,15 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
163163
164164 let val = match val {
165165 ConstValue :: Scalar ( x) => {
166- let Abi :: Scalar ( scalar) = layout. abi else {
166+ let IrForm :: Scalar ( scalar) = layout. ir_form else {
167167 bug ! ( "from_const: invalid ByVal layout: {:#?}" , layout) ;
168168 } ;
169169 let llval = bx. scalar_to_backend ( x, scalar, bx. immediate_backend_type ( layout) ) ;
170170 OperandValue :: Immediate ( llval)
171171 }
172172 ConstValue :: ZeroSized => return OperandRef :: zero_sized ( layout) ,
173173 ConstValue :: Slice { data, meta } => {
174- let Abi :: ScalarPair ( a_scalar, _) = layout. abi else {
174+ let IrForm :: ScalarPair ( a_scalar, _) = layout. ir_form else {
175175 bug ! ( "from_const: invalid ScalarPair layout: {:#?}" , layout) ;
176176 } ;
177177 let a = Scalar :: from_pointer (
@@ -221,14 +221,14 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
221221 // case where some of the bytes are initialized and others are not. So, we need an extra
222222 // check that walks over the type of `mplace` to make sure it is truly correct to treat this
223223 // like a `Scalar` (or `ScalarPair`).
224- match layout. abi {
225- Abi :: Scalar ( s @ abi:: Scalar :: Initialized { .. } ) => {
224+ match layout. ir_form {
225+ IrForm :: Scalar ( s @ abi:: Scalar :: Initialized { .. } ) => {
226226 let size = s. size ( bx) ;
227227 assert_eq ! ( size, layout. size, "abi::Scalar size does not match layout size" ) ;
228228 let val = read_scalar ( offset, size, s, bx. immediate_backend_type ( layout) ) ;
229229 OperandRef { val : OperandValue :: Immediate ( val) , layout }
230230 }
231- Abi :: ScalarPair (
231+ IrForm :: ScalarPair (
232232 a @ abi:: Scalar :: Initialized { .. } ,
233233 b @ abi:: Scalar :: Initialized { .. } ,
234234 ) => {
@@ -322,7 +322,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
322322 llval : V ,
323323 layout : TyAndLayout < ' tcx > ,
324324 ) -> Self {
325- let val = if let Abi :: ScalarPair ( ..) = layout. abi {
325+ let val = if let IrForm :: ScalarPair ( ..) = layout. ir_form {
326326 debug ! ( "Operand::from_immediate_or_packed_pair: unpacking {:?} @ {:?}" , llval, layout) ;
327327
328328 // Deconstruct the immediate aggregate.
@@ -343,7 +343,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
343343 let field = self . layout . field ( bx. cx ( ) , i) ;
344344 let offset = self . layout . fields . offset ( i) ;
345345
346- let mut val = match ( self . val , self . layout . abi ) {
346+ let mut val = match ( self . val , self . layout . ir_form ) {
347347 // If the field is ZST, it has no data.
348348 _ if field. is_zst ( ) => OperandValue :: ZeroSized ,
349349
@@ -356,7 +356,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
356356 }
357357
358358 // Extract a scalar component from a pair.
359- ( OperandValue :: Pair ( a_llval, b_llval) , Abi :: ScalarPair ( a, b) ) => {
359+ ( OperandValue :: Pair ( a_llval, b_llval) , IrForm :: ScalarPair ( a, b) ) => {
360360 if offset. bytes ( ) == 0 {
361361 assert_eq ! ( field. size, a. size( bx. cx( ) ) ) ;
362362 OperandValue :: Immediate ( a_llval)
@@ -368,30 +368,30 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
368368 }
369369
370370 // `#[repr(simd)]` types are also immediate.
371- ( OperandValue :: Immediate ( llval) , Abi :: Vector { .. } ) => {
371+ ( OperandValue :: Immediate ( llval) , IrForm :: Vector { .. } ) => {
372372 OperandValue :: Immediate ( bx. extract_element ( llval, bx. cx ( ) . const_usize ( i as u64 ) ) )
373373 }
374374
375375 _ => bug ! ( "OperandRef::extract_field({:?}): not applicable" , self ) ,
376376 } ;
377377
378- match ( & mut val, field. abi ) {
378+ match ( & mut val, field. ir_form ) {
379379 ( OperandValue :: ZeroSized , _) => { }
380380 (
381381 OperandValue :: Immediate ( llval) ,
382- Abi :: Scalar ( _) | Abi :: ScalarPair ( ..) | Abi :: Vector { .. } ,
382+ IrForm :: Scalar ( _) | IrForm :: ScalarPair ( ..) | IrForm :: Vector { .. } ,
383383 ) => {
384384 // Bools in union fields needs to be truncated.
385385 * llval = bx. to_immediate ( * llval, field) ;
386386 }
387- ( OperandValue :: Pair ( a, b) , Abi :: ScalarPair ( a_abi, b_abi) ) => {
387+ ( OperandValue :: Pair ( a, b) , IrForm :: ScalarPair ( a_abi, b_abi) ) => {
388388 // Bools in union fields needs to be truncated.
389389 * a = bx. to_immediate_scalar ( * a, a_abi) ;
390390 * b = bx. to_immediate_scalar ( * b, b_abi) ;
391391 }
392392 // Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]);
393- ( OperandValue :: Immediate ( llval) , Abi :: Aggregate { sized : true } ) => {
394- assert_matches ! ( self . layout. abi , Abi :: Vector { .. } ) ;
393+ ( OperandValue :: Immediate ( llval) , IrForm :: Memory { sized : true } ) => {
394+ assert_matches ! ( self . layout. ir_form , IrForm :: Vector { .. } ) ;
395395
396396 let llfield_ty = bx. cx ( ) . backend_type ( field) ;
397397
@@ -400,7 +400,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
400400 bx. store ( * llval, llptr, field. align . abi ) ;
401401 * llval = bx. load ( llfield_ty, llptr, field. align . abi ) ;
402402 }
403- ( OperandValue :: Immediate ( _) , Abi :: Uninhabited | Abi :: Aggregate { sized : false } ) => {
403+ ( OperandValue :: Immediate ( _) , IrForm :: Uninhabited | IrForm :: Memory { sized : false } ) => {
404404 bug ! ( )
405405 }
406406 ( OperandValue :: Pair ( ..) , _) => bug ! ( ) ,
@@ -494,7 +494,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandValue<V> {
494494 bx. store_with_flags ( val, dest. val . llval , dest. val . align , flags) ;
495495 }
496496 OperandValue :: Pair ( a, b) => {
497- let Abi :: ScalarPair ( a_scalar, b_scalar) = dest. layout . abi else {
497+ let IrForm :: ScalarPair ( a_scalar, b_scalar) = dest. layout . ir_form else {
498498 bug ! ( "store_with_flags: invalid ScalarPair layout: {:#?}" , dest. layout) ;
499499 } ;
500500 let b_offset = a_scalar. size ( bx) . align_to ( b_scalar. align ( bx) . abi ) ;
@@ -645,7 +645,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
645645 // However, some SIMD types do not actually use the vector ABI
646646 // (in particular, packed SIMD types do not). Ensure we exclude those.
647647 let layout = bx. layout_of ( constant_ty) ;
648- if let Abi :: Vector { .. } = layout. abi {
648+ if let IrForm :: Vector { .. } = layout. ir_form {
649649 let ( llval, ty) = self . immediate_const_vector ( bx, constant) ;
650650 return OperandRef {
651651 val : OperandValue :: Immediate ( llval) ,
0 commit comments