@@ -131,8 +131,8 @@ impl<'tcx> CValue<'tcx> {
131
131
132
132
match self . 0 {
133
133
CValueInner :: ByRef ( ptr, None ) => {
134
- let ( a_scalar, b_scalar) = match self . 1 . abi {
135
- Abi :: ScalarPair ( a, b) => ( a, b) ,
134
+ let ( a_scalar, b_scalar) = match self . 1 . backend_repr {
135
+ BackendRepr :: ScalarPair ( a, b) => ( a, b) ,
136
136
_ => unreachable ! ( "dyn_star_force_data_on_stack({:?})" , self ) ,
137
137
} ;
138
138
let b_offset = scalar_pair_calculate_b_offset ( fx. tcx , a_scalar, b_scalar) ;
@@ -164,15 +164,15 @@ impl<'tcx> CValue<'tcx> {
164
164
}
165
165
}
166
166
167
- /// Load a value with layout.abi of scalar
167
+ /// Load a value with layout.backend_repr of scalar
168
168
#[ track_caller]
169
169
pub ( crate ) fn load_scalar ( self , fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ) -> Value {
170
170
let layout = self . 1 ;
171
171
match self . 0 {
172
172
CValueInner :: ByRef ( ptr, None ) => {
173
- let clif_ty = match layout. abi {
174
- Abi :: Scalar ( scalar) => scalar_to_clif_type ( fx. tcx , scalar) ,
175
- Abi :: Vector { element, count } => scalar_to_clif_type ( fx. tcx , element)
173
+ let clif_ty = match layout. backend_repr {
174
+ BackendRepr :: Scalar ( scalar) => scalar_to_clif_type ( fx. tcx , scalar) ,
175
+ BackendRepr :: Vector { element, count } => scalar_to_clif_type ( fx. tcx , element)
176
176
. by ( u32:: try_from ( count) . unwrap ( ) )
177
177
. unwrap ( ) ,
178
178
_ => unreachable ! ( "{:?}" , layout. ty) ,
@@ -187,14 +187,14 @@ impl<'tcx> CValue<'tcx> {
187
187
}
188
188
}
189
189
190
- /// Load a value pair with layout.abi of scalar pair
190
+ /// Load a value pair with layout.backend_repr of scalar pair
191
191
#[ track_caller]
192
192
pub ( crate ) fn load_scalar_pair ( self , fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ) -> ( Value , Value ) {
193
193
let layout = self . 1 ;
194
194
match self . 0 {
195
195
CValueInner :: ByRef ( ptr, None ) => {
196
- let ( a_scalar, b_scalar) = match layout. abi {
197
- Abi :: ScalarPair ( a, b) => ( a, b) ,
196
+ let ( a_scalar, b_scalar) = match layout. backend_repr {
197
+ BackendRepr :: ScalarPair ( a, b) => ( a, b) ,
198
198
_ => unreachable ! ( "load_scalar_pair({:?})" , self ) ,
199
199
} ;
200
200
let b_offset = scalar_pair_calculate_b_offset ( fx. tcx , a_scalar, b_scalar) ;
@@ -222,8 +222,8 @@ impl<'tcx> CValue<'tcx> {
222
222
let layout = self . 1 ;
223
223
match self . 0 {
224
224
CValueInner :: ByVal ( _) => unreachable ! ( ) ,
225
- CValueInner :: ByValPair ( val1, val2) => match layout. abi {
226
- Abi :: ScalarPair ( _, _) => {
225
+ CValueInner :: ByValPair ( val1, val2) => match layout. backend_repr {
226
+ BackendRepr :: ScalarPair ( _, _) => {
227
227
let val = match field. as_u32 ( ) {
228
228
0 => val1,
229
229
1 => val2,
@@ -232,7 +232,7 @@ impl<'tcx> CValue<'tcx> {
232
232
let field_layout = layout. field ( & * fx, usize:: from ( field) ) ;
233
233
CValue :: by_val ( val, field_layout)
234
234
}
235
- _ => unreachable ! ( "value_field for ByValPair with abi {:?}" , layout. abi ) ,
235
+ _ => unreachable ! ( "value_field for ByValPair with abi {:?}" , layout. backend_repr ) ,
236
236
} ,
237
237
CValueInner :: ByRef ( ptr, None ) => {
238
238
let ( field_ptr, field_layout) = codegen_field ( fx, ptr, None , layout, field) ;
@@ -360,7 +360,7 @@ impl<'tcx> CValue<'tcx> {
360
360
pub ( crate ) fn cast_pointer_to ( self , layout : TyAndLayout < ' tcx > ) -> Self {
361
361
assert ! ( matches!( self . layout( ) . ty. kind( ) , ty:: Ref ( ..) | ty:: RawPtr ( ..) | ty:: FnPtr ( ..) ) ) ;
362
362
assert ! ( matches!( layout. ty. kind( ) , ty:: Ref ( ..) | ty:: RawPtr ( ..) | ty:: FnPtr ( ..) ) ) ;
363
- assert_eq ! ( self . layout( ) . abi , layout. abi ) ;
363
+ assert_eq ! ( self . layout( ) . backend_repr , layout. backend_repr ) ;
364
364
CValue ( self . 0 , layout)
365
365
}
366
366
}
@@ -609,8 +609,8 @@ impl<'tcx> CPlace<'tcx> {
609
609
let dst_layout = self . layout ( ) ;
610
610
match self . inner {
611
611
CPlaceInner :: Var ( _local, var) => {
612
- let data = match from. 1 . abi {
613
- Abi :: Scalar ( _) => CValue ( from. 0 , dst_layout) . load_scalar ( fx) ,
612
+ let data = match from. 1 . backend_repr {
613
+ BackendRepr :: Scalar ( _) => CValue ( from. 0 , dst_layout) . load_scalar ( fx) ,
614
614
_ => {
615
615
let ( ptr, meta) = from. force_stack ( fx) ;
616
616
assert ! ( meta. is_none( ) ) ;
@@ -621,8 +621,10 @@ impl<'tcx> CPlace<'tcx> {
621
621
transmute_scalar ( fx, var, data, dst_ty) ;
622
622
}
623
623
CPlaceInner :: VarPair ( _local, var1, var2) => {
624
- let ( data1, data2) = match from. 1 . abi {
625
- Abi :: ScalarPair ( _, _) => CValue ( from. 0 , dst_layout) . load_scalar_pair ( fx) ,
624
+ let ( data1, data2) = match from. 1 . backend_repr {
625
+ BackendRepr :: ScalarPair ( _, _) => {
626
+ CValue ( from. 0 , dst_layout) . load_scalar_pair ( fx)
627
+ }
626
628
_ => {
627
629
let ( ptr, meta) = from. force_stack ( fx) ;
628
630
assert ! ( meta. is_none( ) ) ;
@@ -635,7 +637,9 @@ impl<'tcx> CPlace<'tcx> {
635
637
}
636
638
CPlaceInner :: Addr ( _, Some ( _) ) => bug ! ( "Can't write value to unsized place {:?}" , self ) ,
637
639
CPlaceInner :: Addr ( to_ptr, None ) => {
638
- if dst_layout. size == Size :: ZERO || dst_layout. abi == Abi :: Uninhabited {
640
+ if dst_layout. size == Size :: ZERO
641
+ || dst_layout. backend_repr == BackendRepr :: Uninhabited
642
+ {
639
643
return ;
640
644
}
641
645
@@ -646,23 +650,28 @@ impl<'tcx> CPlace<'tcx> {
646
650
CValueInner :: ByVal ( val) => {
647
651
to_ptr. store ( fx, val, flags) ;
648
652
}
649
- CValueInner :: ByValPair ( val1, val2) => match from. layout ( ) . abi {
650
- Abi :: ScalarPair ( a_scalar, b_scalar) => {
653
+ CValueInner :: ByValPair ( val1, val2) => match from. layout ( ) . backend_repr {
654
+ BackendRepr :: ScalarPair ( a_scalar, b_scalar) => {
651
655
let b_offset =
652
656
scalar_pair_calculate_b_offset ( fx. tcx , a_scalar, b_scalar) ;
653
657
to_ptr. store ( fx, val1, flags) ;
654
658
to_ptr. offset ( fx, b_offset) . store ( fx, val2, flags) ;
655
659
}
656
- _ => bug ! ( "Non ScalarPair abi {:?} for ByValPair CValue" , dst_layout. abi) ,
660
+ _ => {
661
+ bug ! (
662
+ "Non ScalarPair repr {:?} for ByValPair CValue" ,
663
+ dst_layout. backend_repr
664
+ )
665
+ }
657
666
} ,
658
667
CValueInner :: ByRef ( from_ptr, None ) => {
659
- match from. layout ( ) . abi {
660
- Abi :: Scalar ( _) => {
668
+ match from. layout ( ) . backend_repr {
669
+ BackendRepr :: Scalar ( _) => {
661
670
let val = from. load_scalar ( fx) ;
662
671
to_ptr. store ( fx, val, flags) ;
663
672
return ;
664
673
}
665
- Abi :: ScalarPair ( a_scalar, b_scalar) => {
674
+ BackendRepr :: ScalarPair ( a_scalar, b_scalar) => {
666
675
let b_offset =
667
676
scalar_pair_calculate_b_offset ( fx. tcx , a_scalar, b_scalar) ;
668
677
let ( val1, val2) = from. load_scalar_pair ( fx) ;
0 commit comments