@@ -22,7 +22,7 @@ use rustc_codegen_ssa::traits::{
22
22
} ;
23
23
use rustc_middle:: bug;
24
24
#[ cfg( feature = "master" ) ]
25
- use rustc_middle:: ty:: layout:: { FnAbiOf , HasTyCtxt } ;
25
+ use rustc_middle:: ty:: layout:: FnAbiOf ;
26
26
use rustc_middle:: ty:: layout:: { HasTypingEnv , LayoutOf } ;
27
27
use rustc_middle:: ty:: { self , Instance , Ty } ;
28
28
use rustc_span:: { Span , Symbol , sym} ;
@@ -202,7 +202,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
202
202
instance : Instance < ' tcx > ,
203
203
fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
204
204
args : & [ OperandRef < ' tcx , RValue < ' gcc > > ] ,
205
- llresult : RValue < ' gcc > ,
205
+ result : PlaceRef < ' tcx , RValue < ' gcc > > ,
206
206
span : Span ,
207
207
) -> Result < ( ) , Instance < ' tcx > > {
208
208
let tcx = self . tcx ;
@@ -221,7 +221,6 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
221
221
let name_str = name. as_str ( ) ;
222
222
223
223
let llret_ty = self . layout_of ( ret_ty) . gcc_type ( self ) ;
224
- let result = PlaceRef :: new_sized ( llresult, fn_abi. ret . layout ) ;
225
224
226
225
let simple = get_simple_intrinsic ( self , name) ;
227
226
let simple_func = get_simple_function ( self , name) ;
@@ -271,7 +270,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
271
270
args[ 0 ] . immediate ( ) ,
272
271
args[ 1 ] . immediate ( ) ,
273
272
args[ 2 ] . immediate ( ) ,
274
- llresult ,
273
+ result ,
275
274
) ;
276
275
return Ok ( ( ) ) ;
277
276
}
@@ -1230,14 +1229,13 @@ fn try_intrinsic<'a, 'b, 'gcc, 'tcx>(
1230
1229
try_func : RValue < ' gcc > ,
1231
1230
data : RValue < ' gcc > ,
1232
1231
_catch_func : RValue < ' gcc > ,
1233
- dest : RValue < ' gcc > ,
1232
+ dest : PlaceRef < ' tcx , RValue < ' gcc > > ,
1234
1233
) {
1235
1234
if bx. sess ( ) . panic_strategy ( ) == PanicStrategy :: Abort {
1236
1235
bx. call ( bx. type_void ( ) , None , None , try_func, & [ data] , None , None ) ;
1237
1236
// Return 0 unconditionally from the intrinsic call;
1238
1237
// we can never unwind.
1239
- let ret_align = bx. tcx . data_layout . i32_align . abi ;
1240
- bx. store ( bx. const_i32 ( 0 ) , dest, ret_align) ;
1238
+ OperandValue :: Immediate ( bx. const_i32 ( 0 ) ) . store ( bx, dest) ;
1241
1239
} else {
1242
1240
if wants_msvc_seh ( bx. sess ( ) ) {
1243
1241
unimplemented ! ( ) ;
@@ -1261,12 +1259,12 @@ fn try_intrinsic<'a, 'b, 'gcc, 'tcx>(
1261
1259
// functions in play. By calling a shim we're guaranteed that our shim will have
1262
1260
// the right personality function.
1263
1261
#[ cfg( feature = "master" ) ]
1264
- fn codegen_gnu_try < ' gcc > (
1265
- bx : & mut Builder < ' _ , ' gcc , ' _ > ,
1262
+ fn codegen_gnu_try < ' gcc , ' tcx > (
1263
+ bx : & mut Builder < ' _ , ' gcc , ' tcx > ,
1266
1264
try_func : RValue < ' gcc > ,
1267
1265
data : RValue < ' gcc > ,
1268
1266
catch_func : RValue < ' gcc > ,
1269
- dest : RValue < ' gcc > ,
1267
+ dest : PlaceRef < ' tcx , RValue < ' gcc > > ,
1270
1268
) {
1271
1269
let cx: & CodegenCx < ' gcc , ' _ > = bx. cx ;
1272
1270
let ( llty, func) = get_rust_try_fn ( cx, & mut |mut bx| {
@@ -1322,8 +1320,7 @@ fn codegen_gnu_try<'gcc>(
1322
1320
// Note that no invoke is used here because by definition this function
1323
1321
// can't panic (that's what it's catching).
1324
1322
let ret = bx. call ( llty, None , None , func, & [ try_func, data, catch_func] , None , None ) ;
1325
- let i32_align = bx. tcx ( ) . data_layout . i32_align . abi ;
1326
- bx. store ( ret, dest, i32_align) ;
1323
+ OperandValue :: Immediate ( ret) . store ( bx, dest) ;
1327
1324
}
1328
1325
1329
1326
// Helper function used to get a handle to the `__rust_try` function used to
0 commit comments