@@ -15,7 +15,6 @@ use rustc_target::callconv::{Conv, RiscvInterruptKind};
1515
1616use crate :: builder:: Builder ;
1717use crate :: context:: CodegenCx ;
18- use crate :: intrinsic:: ArgAbiExt ;
1918use crate :: type_of:: LayoutGccExt ;
2019
2120impl AbiBuilderMethods for Builder < ' _ , ' _ , ' _ > {
@@ -125,7 +124,7 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
125124 PassMode :: Direct ( _) | PassMode :: Pair ( ..) => self . ret . layout . immediate_gcc_type ( cx) ,
126125 PassMode :: Cast { ref cast, .. } => cast. gcc_type ( cx) ,
127126 PassMode :: Indirect { .. } => {
128- argument_tys. push ( cx. type_ptr_to ( self . ret . memory_ty ( cx) ) ) ;
127+ argument_tys. push ( cx. type_ptr_to ( self . ret . layout . gcc_type ( cx) ) ) ;
129128 cx. type_void ( )
130129 }
131130 } ;
@@ -176,13 +175,13 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
176175 PassMode :: Indirect { attrs : _, meta_attrs : None , on_stack : true } => {
177176 // This is a "byval" argument, so we don't apply the `restrict` attribute on it.
178177 on_stack_param_indices. insert ( argument_tys. len ( ) ) ;
179- arg. memory_ty ( cx)
178+ arg. layout . gcc_type ( cx)
180179 }
181180 PassMode :: Direct ( attrs) => {
182181 apply_attrs ( arg. layout . immediate_gcc_type ( cx) , & attrs, argument_tys. len ( ) )
183182 }
184183 PassMode :: Indirect { attrs, meta_attrs : None , on_stack : false } => {
185- apply_attrs ( cx. type_ptr_to ( arg. memory_ty ( cx) ) , & attrs, argument_tys. len ( ) )
184+ apply_attrs ( cx. type_ptr_to ( arg. layout . gcc_type ( cx) ) , & attrs, argument_tys. len ( ) )
186185 }
187186 PassMode :: Indirect { attrs, meta_attrs : Some ( meta_attrs) , on_stack } => {
188187 assert ! ( !on_stack) ;
0 commit comments