@@ -4,8 +4,8 @@ use crate::llvm::{self, Value};
4
4
use crate :: target;
5
5
use crate :: ty:: LayoutLlvmExt ;
6
6
use crate :: { builder:: Builder , context:: CodegenCx } ;
7
- use rustc_codegen_ssa:: mir:: place:: PlaceRef ;
8
7
use rustc_codegen_ssa:: errors:: InvalidMonomorphization :: BasicIntegerType ;
8
+ use rustc_codegen_ssa:: mir:: place:: PlaceRef ;
9
9
use rustc_codegen_ssa:: traits:: DerivedTypeMethods ;
10
10
use rustc_codegen_ssa:: traits:: { BaseTypeMethods , BuilderMethods , ConstMethods , OverflowOp } ;
11
11
use rustc_codegen_ssa:: { mir:: operand:: OperandRef , traits:: IntrinsicCallMethods } ;
@@ -199,6 +199,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
199
199
_ if simple. is_some ( ) => self . call (
200
200
self . type_i1 ( ) ,
201
201
None ,
202
+ None ,
202
203
simple. unwrap ( ) ,
203
204
& args. iter ( ) . map ( |arg| arg. immediate ( ) ) . collect :: < Vec < _ > > ( ) ,
204
205
None ,
@@ -208,6 +209,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
208
209
self . call (
209
210
self . type_i1 ( ) ,
210
211
None ,
212
+ None ,
211
213
expect,
212
214
& [ args[ 0 ] . immediate ( ) , self . const_bool ( true ) ] ,
213
215
None ,
@@ -218,6 +220,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
218
220
self . call (
219
221
self . type_i1 ( ) ,
220
222
None ,
223
+ None ,
221
224
expect,
222
225
& [ args[ 0 ] . immediate ( ) , self . const_bool ( false ) ] ,
223
226
None ,
@@ -227,7 +230,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
227
230
let try_func = args[ 0 ] . immediate ( ) ;
228
231
let data = args[ 1 ] . immediate ( ) ;
229
232
230
- self . call ( self . type_i1 ( ) , None , try_func, & [ data] , None ) ;
233
+ self . call ( self . type_i1 ( ) , None , None , try_func, & [ data] , None ) ;
231
234
let ret_align = self . data_layout ( ) . i32_align . abi ;
232
235
self . store ( self . const_i32 ( 0 ) , llresult, ret_align)
233
236
}
@@ -240,6 +243,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
240
243
self . call (
241
244
self . type_i1 ( ) ,
242
245
None ,
246
+ None ,
243
247
intrinsic,
244
248
& [ args[ 0 ] . immediate ( ) , args[ 1 ] . immediate ( ) ] ,
245
249
None ,
@@ -318,7 +322,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
318
322
_ => bug ! ( ) ,
319
323
} ;
320
324
self . call (
321
- self . type_i1 ( ) ,
325
+ self . type_i1 ( ) , None ,
322
326
None ,
323
327
expect,
324
328
& [
@@ -345,9 +349,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
345
349
let ( width, signed) = if let Some ( res) = int_type_width_signed ( ty, self . cx ) {
346
350
res
347
351
} else {
348
- tcx
349
- . sess
350
- . emit_err ( BasicIntegerType { span, name, ty } ) ;
352
+ tcx. sess . emit_err ( BasicIntegerType { span, name, ty } ) ;
351
353
return ;
352
354
} ;
353
355
if name == sym:: saturating_add || name == sym:: saturating_sub {
@@ -371,7 +373,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
371
373
let y = self . const_bool ( true ) ;
372
374
let llvm_name = & format ! ( "llvm.{}.i{}" , & name_str[ ..4 ] , width) ;
373
375
let llfn = self . get_intrinsic ( llvm_name) ;
374
- self . call ( self . type_i1 ( ) , None , llfn, & [ args[ 0 ] . immediate ( ) , y] , None )
376
+ self . call ( self . type_i1 ( ) , None , None , llfn, & [ args[ 0 ] . immediate ( ) , y] , None )
375
377
}
376
378
sym:: ctpop => self . call (
377
379
self . type_i1 ( ) ,
@@ -394,7 +396,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
394
396
}
395
397
}
396
398
sym:: bitreverse => self . call (
397
- self . type_i1 ( ) ,
399
+ self . type_i1 ( ) , None ,
398
400
None ,
399
401
self . get_intrinsic ( & format ! ( "llvm.bitreverse.i{}" , width) ) ,
400
402
& [ args[ 0 ] . immediate ( ) ] ,
@@ -421,7 +423,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
421
423
width
422
424
) ;
423
425
let llfn = self . get_intrinsic ( llvm_name) ;
424
- self . call ( self . type_i1 ( ) , None , llfn, & [ lhs, rhs] , None )
426
+ self . call ( self . type_i1 ( ) , None , None , llfn, & [ lhs, rhs] , None )
425
427
}
426
428
_ => unreachable ! ( ) ,
427
429
}
@@ -492,7 +494,7 @@ impl<'a, 'll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
492
494
fn assume ( & mut self , val : Self :: Value ) {
493
495
trace ! ( "Generate assume call with `{:?}`" , val) ;
494
496
let assume_intrinsic = self . get_intrinsic ( "llvm.assume" ) ;
495
- self . call ( self . type_i1 ( ) , None , assume_intrinsic, & [ val] , None ) ;
497
+ self . call ( self . type_i1 ( ) , None , None , assume_intrinsic, & [ val] , None ) ;
496
498
}
497
499
498
500
fn expect ( & mut self , cond : Self :: Value , expected : bool ) -> Self :: Value {
0 commit comments