@@ -24,7 +24,7 @@ pub(crate) use llvm::codegen_llvm_intrinsic_call;
24
24
use rustc_middle:: ty;
25
25
use rustc_middle:: ty:: layout:: { HasParamEnv , ValidityRequirement } ;
26
26
use rustc_middle:: ty:: print:: { with_no_trimmed_paths, with_no_visible_paths} ;
27
- use rustc_middle:: ty:: subst :: SubstsRef ;
27
+ use rustc_middle:: ty:: GenericArgsRef ;
28
28
use rustc_span:: symbol:: { kw, sym, Symbol } ;
29
29
30
30
use crate :: prelude:: * ;
@@ -213,13 +213,13 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
213
213
source_info : mir:: SourceInfo ,
214
214
) {
215
215
let intrinsic = fx. tcx . item_name ( instance. def_id ( ) ) ;
216
- let substs = instance. substs ;
216
+ let instance_args = instance. args ;
217
217
218
218
if intrinsic. as_str ( ) . starts_with ( "simd_" ) {
219
219
self :: simd:: codegen_simd_intrinsic_call (
220
220
fx,
221
221
intrinsic,
222
- substs ,
222
+ instance_args ,
223
223
args,
224
224
destination,
225
225
target. expect ( "target for simd intrinsic" ) ,
@@ -233,7 +233,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
233
233
fx,
234
234
instance,
235
235
intrinsic,
236
- substs ,
236
+ instance_args ,
237
237
args,
238
238
destination,
239
239
target,
@@ -365,7 +365,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
365
365
fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
366
366
instance : Instance < ' tcx > ,
367
367
intrinsic : Symbol ,
368
- substs : SubstsRef < ' tcx > ,
368
+ generic_args : GenericArgsRef < ' tcx > ,
369
369
args : & [ mir:: Operand < ' tcx > ] ,
370
370
ret : CPlace < ' tcx > ,
371
371
destination : Option < BasicBlock > ,
@@ -394,7 +394,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
394
394
let dst = dst. load_scalar ( fx) ;
395
395
let count = count. load_scalar ( fx) ;
396
396
397
- let elem_ty = substs . type_at ( 0 ) ;
397
+ let elem_ty = generic_args . type_at ( 0 ) ;
398
398
let elem_size: u64 = fx. layout_of ( elem_ty) . size . bytes ( ) ;
399
399
assert_eq ! ( args. len( ) , 3 ) ;
400
400
let byte_amount =
@@ -410,7 +410,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
410
410
let src = src. load_scalar ( fx) ;
411
411
let count = count. load_scalar ( fx) ;
412
412
413
- let elem_ty = substs . type_at ( 0 ) ;
413
+ let elem_ty = generic_args . type_at ( 0 ) ;
414
414
let elem_size: u64 = fx. layout_of ( elem_ty) . size . bytes ( ) ;
415
415
assert_eq ! ( args. len( ) , 3 ) ;
416
416
let byte_amount =
@@ -428,7 +428,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
428
428
sym:: size_of_val => {
429
429
intrinsic_args ! ( fx, args => ( ptr) ; intrinsic) ;
430
430
431
- let layout = fx. layout_of ( substs . type_at ( 0 ) ) ;
431
+ let layout = fx. layout_of ( generic_args . type_at ( 0 ) ) ;
432
432
// Note: Can't use is_unsized here as truly unsized types need to take the fixed size
433
433
// branch
434
434
let size = if let Abi :: ScalarPair ( _, _) = ptr. layout ( ) . abi {
@@ -443,7 +443,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
443
443
sym:: min_align_of_val => {
444
444
intrinsic_args ! ( fx, args => ( ptr) ; intrinsic) ;
445
445
446
- let layout = fx. layout_of ( substs . type_at ( 0 ) ) ;
446
+ let layout = fx. layout_of ( generic_args . type_at ( 0 ) ) ;
447
447
// Note: Can't use is_unsized here as truly unsized types need to take the fixed size
448
448
// branch
449
449
let align = if let Abi :: ScalarPair ( _, _) = ptr. layout ( ) . abi {
@@ -602,7 +602,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
602
602
sym:: assert_inhabited | sym:: assert_zero_valid | sym:: assert_mem_uninitialized_valid => {
603
603
intrinsic_args ! ( fx, args => ( ) ; intrinsic) ;
604
604
605
- let ty = substs . type_at ( 0 ) ;
605
+ let ty = generic_args . type_at ( 0 ) ;
606
606
607
607
let requirement = ValidityRequirement :: from_intrinsic ( intrinsic) ;
608
608
@@ -674,7 +674,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
674
674
intrinsic_args ! ( fx, args => ( ptr, base) ; intrinsic) ;
675
675
let ptr = ptr. load_scalar ( fx) ;
676
676
let base = base. load_scalar ( fx) ;
677
- let ty = substs . type_at ( 0 ) ;
677
+ let ty = generic_args . type_at ( 0 ) ;
678
678
679
679
let pointee_size: u64 = fx. layout_of ( ty) . size . bytes ( ) ;
680
680
let diff_bytes = fx. bcx . ins ( ) . isub ( ptr, base) ;
@@ -720,7 +720,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
720
720
intrinsic_args ! ( fx, args => ( ptr) ; intrinsic) ;
721
721
let ptr = ptr. load_scalar ( fx) ;
722
722
723
- let ty = substs . type_at ( 0 ) ;
723
+ let ty = generic_args . type_at ( 0 ) ;
724
724
match ty. kind ( ) {
725
725
ty:: Uint ( UintTy :: U128 ) | ty:: Int ( IntTy :: I128 ) => {
726
726
// FIXME implement 128bit atomics
@@ -751,7 +751,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
751
751
intrinsic_args ! ( fx, args => ( ptr, val) ; intrinsic) ;
752
752
let ptr = ptr. load_scalar ( fx) ;
753
753
754
- let ty = substs . type_at ( 0 ) ;
754
+ let ty = generic_args . type_at ( 0 ) ;
755
755
match ty. kind ( ) {
756
756
ty:: Uint ( UintTy :: U128 ) | ty:: Int ( IntTy :: I128 ) => {
757
757
// FIXME implement 128bit atomics
@@ -1128,7 +1128,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
1128
1128
let lhs_ref = lhs_ref. load_scalar ( fx) ;
1129
1129
let rhs_ref = rhs_ref. load_scalar ( fx) ;
1130
1130
1131
- let size = fx. layout_of ( substs . type_at ( 0 ) ) . layout . size ( ) ;
1131
+ let size = fx. layout_of ( generic_args . type_at ( 0 ) ) . layout . size ( ) ;
1132
1132
// FIXME add and use emit_small_memcmp
1133
1133
let is_eq_value = if size == Size :: ZERO {
1134
1134
// No bytes means they're trivially equal
0 commit comments