@@ -127,20 +127,13 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
127
127
// https://github.com/rust-lang/rust-clippy/issues/12497
128
128
// and leave `else if use_integer_compare` to be placed "as is".
129
129
#[ allow( clippy:: suspicious_else_formatting) ]
130
- let llval = match name {
130
+ let value = match name {
131
131
_ if simple. is_some ( ) => {
132
- // FIXME(antoyo): remove this cast when the API supports function.
133
- let func = unsafe {
134
- std:: mem:: transmute :: < Function < ' gcc > , RValue < ' gcc > > ( simple. expect ( "simple" ) )
135
- } ;
136
- self . call (
137
- self . type_void ( ) ,
138
- None ,
139
- None ,
132
+ let func = simple. expect ( "simple function" ) ;
133
+ self . cx . context . new_call (
134
+ self . location ,
140
135
func,
141
136
& args. iter ( ) . map ( |arg| arg. immediate ( ) ) . collect :: < Vec < _ > > ( ) ,
142
- None ,
143
- None ,
144
137
)
145
138
}
146
139
sym:: likely => self . expect ( args[ 0 ] . immediate ( ) , true ) ,
@@ -383,7 +376,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
383
376
384
377
_ if name_str. starts_with ( "simd_" ) => {
385
378
match generic_simd_intrinsic ( self , name, callee_ty, args, ret_ty, llret_ty, span) {
386
- Ok ( llval ) => llval ,
379
+ Ok ( value ) => value ,
387
380
Err ( ( ) ) => return Ok ( ( ) ) ,
388
381
}
389
382
}
@@ -396,9 +389,9 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
396
389
if let PassMode :: Cast { cast : ref ty, .. } = fn_abi. ret . mode {
397
390
let ptr_llty = self . type_ptr_to ( ty. gcc_type ( self ) ) ;
398
391
let ptr = self . pointercast ( result. val . llval , ptr_llty) ;
399
- self . store ( llval , ptr, result. val . align ) ;
392
+ self . store ( value , ptr, result. val . align ) ;
400
393
} else {
401
- OperandRef :: from_immediate_or_packed_pair ( self , llval , result. layout )
394
+ OperandRef :: from_immediate_or_packed_pair ( self , value , result. layout )
402
395
. val
403
396
. store ( self , result) ;
404
397
}
0 commit comments