@@ -3,7 +3,7 @@ use std::fmt::Write;
33use gccjit:: { Struct , Type } ;
44use rustc_abi as abi;
55use rustc_abi:: Primitive :: * ;
6- use rustc_abi:: { Abi , FieldsShape , Integer , PointeeInfo , Size , Variants } ;
6+ use rustc_abi:: { BackendRepr , FieldsShape , Integer , PointeeInfo , Size , Variants } ;
77use rustc_codegen_ssa:: traits:: {
88 BaseTypeCodegenMethods , DerivedTypeCodegenMethods , LayoutTypeCodegenMethods ,
99} ;
@@ -60,9 +60,9 @@ fn uncached_gcc_type<'gcc, 'tcx>(
6060 layout : TyAndLayout < ' tcx > ,
6161 defer : & mut Option < ( Struct < ' gcc > , TyAndLayout < ' tcx > ) > ,
6262) -> Type < ' gcc > {
63- match layout. abi {
64- Abi :: Scalar ( _) => bug ! ( "handled elsewhere" ) ,
65- Abi :: Vector { ref element, count } => {
63+ match layout. backend_repr {
64+ BackendRepr :: Scalar ( _) => bug ! ( "handled elsewhere" ) ,
65+ BackendRepr :: Vector { ref element, count } => {
6666 let element = layout. scalar_gcc_type_at ( cx, element, Size :: ZERO ) ;
6767 let element =
6868 // NOTE: gcc doesn't allow pointer types in vectors.
@@ -74,7 +74,7 @@ fn uncached_gcc_type<'gcc, 'tcx>(
7474 } ;
7575 return cx. context . new_vector_type ( element, count) ;
7676 }
77- Abi :: ScalarPair ( ..) => {
77+ BackendRepr :: ScalarPair ( ..) => {
7878 return cx. type_struct (
7979 & [
8080 layout. scalar_pair_element_gcc_type ( cx, 0 ) ,
@@ -83,7 +83,7 @@ fn uncached_gcc_type<'gcc, 'tcx>(
8383 false ,
8484 ) ;
8585 }
86- Abi :: Uninhabited | Abi :: Aggregate { .. } => { }
86+ BackendRepr :: Uninhabited | BackendRepr :: Memory { .. } => { }
8787 }
8888
8989 let name = match * layout. ty . kind ( ) {
@@ -176,16 +176,21 @@ pub trait LayoutGccExt<'tcx> {
176176
177177impl < ' tcx > LayoutGccExt < ' tcx > for TyAndLayout < ' tcx > {
178178 fn is_gcc_immediate ( & self ) -> bool {
179- match self . abi {
180- Abi :: Scalar ( _) | Abi :: Vector { .. } => true ,
181- Abi :: ScalarPair ( ..) | Abi :: Uninhabited | Abi :: Aggregate { .. } => false ,
179+ match self . backend_repr {
180+ BackendRepr :: Scalar ( _) | BackendRepr :: Vector { .. } => true ,
181+ BackendRepr :: ScalarPair ( ..) | BackendRepr :: Uninhabited | BackendRepr :: Memory { .. } => {
182+ false
183+ }
182184 }
183185 }
184186
185187 fn is_gcc_scalar_pair ( & self ) -> bool {
186- match self . abi {
187- Abi :: ScalarPair ( ..) => true ,
188- Abi :: Uninhabited | Abi :: Scalar ( _) | Abi :: Vector { .. } | Abi :: Aggregate { .. } => false ,
188+ match self . backend_repr {
189+ BackendRepr :: ScalarPair ( ..) => true ,
190+ BackendRepr :: Uninhabited
191+ | BackendRepr :: Scalar ( _)
192+ | BackendRepr :: Vector { .. }
193+ | BackendRepr :: Memory { .. } => false ,
189194 }
190195 }
191196
@@ -205,7 +210,7 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
205210 // This must produce the same result for `repr(transparent)` wrappers as for the inner type!
206211 // In other words, this should generally not look at the type at all, but only at the
207212 // layout.
208- if let Abi :: Scalar ( ref scalar) = self . abi {
213+ if let BackendRepr :: Scalar ( ref scalar) = self . backend_repr {
209214 // Use a different cache for scalars because pointers to DSTs
210215 // can be either wide or thin (data pointers of wide pointers).
211216 if let Some ( & ty) = cx. scalar_types . borrow ( ) . get ( & self . ty ) {
@@ -261,7 +266,7 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
261266 }
262267
263268 fn immediate_gcc_type < ' gcc > ( & self , cx : & CodegenCx < ' gcc , ' tcx > ) -> Type < ' gcc > {
264- if let Abi :: Scalar ( ref scalar) = self . abi {
269+ if let BackendRepr :: Scalar ( ref scalar) = self . backend_repr {
265270 if scalar. is_bool ( ) {
266271 return cx. type_i1 ( ) ;
267272 }
@@ -299,8 +304,8 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
299304 // This must produce the same result for `repr(transparent)` wrappers as for the inner type!
300305 // In other words, this should generally not look at the type at all, but only at the
301306 // layout.
302- let ( a, b) = match self . abi {
303- Abi :: ScalarPair ( ref a, ref b) => ( a, b) ,
307+ let ( a, b) = match self . backend_repr {
308+ BackendRepr :: ScalarPair ( ref a, ref b) => ( a, b) ,
304309 _ => bug ! ( "TyAndLayout::scalar_pair_element_llty({:?}): not applicable" , self ) ,
305310 } ;
306311 let scalar = [ a, b] [ index] ;
0 commit comments