@@ -12,27 +12,15 @@ pub(super) fn codegen_return_param<'tcx>(
1212 ssa_analyzed : & rustc_index:: IndexSlice < Local , crate :: analyze:: SsaKind > ,
1313 block_params_iter : & mut impl Iterator < Item = Value > ,
1414) -> CPlace < ' tcx > {
15- let ( ret_place, ret_param) : ( _ , SmallVec < [ _ ; 2 ] > ) = match fx. fn_abi . as_ref ( ) . unwrap ( ) . ret . mode {
15+ let ( ret_place, ret_param) : ( _ , SmallVec < [ _ ; 2 ] > ) = match fx. fn_abi . ret . mode {
1616 PassMode :: Ignore | PassMode :: Direct ( _) | PassMode :: Pair ( _, _) | PassMode :: Cast { .. } => {
17- let is_ssa =
18- ssa_analyzed[ RETURN_PLACE ] . is_ssa ( fx, fx. fn_abi . as_ref ( ) . unwrap ( ) . ret . layout . ty ) ;
19- (
20- super :: make_local_place (
21- fx,
22- RETURN_PLACE ,
23- fx. fn_abi . as_ref ( ) . unwrap ( ) . ret . layout ,
24- is_ssa,
25- ) ,
26- smallvec ! [ ] ,
27- )
17+ let is_ssa = ssa_analyzed[ RETURN_PLACE ] . is_ssa ( fx, fx. fn_abi . ret . layout . ty ) ;
18+ ( super :: make_local_place ( fx, RETURN_PLACE , fx. fn_abi . ret . layout , is_ssa) , smallvec ! [ ] )
2819 }
2920 PassMode :: Indirect { attrs : _, meta_attrs : None , on_stack : _ } => {
3021 let ret_param = block_params_iter. next ( ) . unwrap ( ) ;
3122 assert_eq ! ( fx. bcx. func. dfg. value_type( ret_param) , fx. pointer_type) ;
32- (
33- CPlace :: for_ptr ( Pointer :: new ( ret_param) , fx. fn_abi . as_ref ( ) . unwrap ( ) . ret . layout ) ,
34- smallvec ! [ ret_param] ,
35- )
23+ ( CPlace :: for_ptr ( Pointer :: new ( ret_param) , fx. fn_abi . ret . layout ) , smallvec ! [ ret_param] )
3624 }
3725 PassMode :: Indirect { attrs : _, meta_attrs : Some ( _) , on_stack : _ } => {
3826 unreachable ! ( "unsized return value" )
@@ -45,8 +33,8 @@ pub(super) fn codegen_return_param<'tcx>(
4533 Some ( RETURN_PLACE ) ,
4634 None ,
4735 & ret_param,
48- & fx. fn_abi . as_ref ( ) . unwrap ( ) . ret . mode ,
49- fx. fn_abi . as_ref ( ) . unwrap ( ) . ret . layout ,
36+ & fx. fn_abi . ret . mode ,
37+ fx. fn_abi . ret . layout ,
5038 ) ;
5139
5240 ret_place
@@ -115,7 +103,7 @@ pub(super) fn codegen_with_call_return_arg<'tcx>(
115103
116104/// Codegen a return instruction with the right return value(s) if any.
117105pub ( crate ) fn codegen_return ( fx : & mut FunctionCx < ' _ , ' _ , ' _ > ) {
118- match fx. fn_abi . as_ref ( ) . unwrap ( ) . ret . mode {
106+ match fx. fn_abi . ret . mode {
119107 PassMode :: Ignore | PassMode :: Indirect { attrs : _, meta_attrs : None , on_stack : _ } => {
120108 fx. bcx . ins ( ) . return_ ( & [ ] ) ;
121109 }
0 commit comments