@@ -213,7 +213,7 @@ impl<'ll, 'tcx> ArgAbiExt<'ll, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
213
213
OperandValue :: Ref ( val, None , self . layout . align . abi ) . store ( bx, dst)
214
214
} else if self . is_unsized_indirect ( ) {
215
215
bug ! ( "unsized `ArgAbi` must be handled through `store_fn_arg`" ) ;
216
- } else if let PassMode :: Cast ( cast) = self . mode {
216
+ } else if let PassMode :: Cast ( cast) = & self . mode {
217
217
// FIXME(eddyb): Figure out when the simpler Store is safe, clang
218
218
// uses it for i16 -> {i8, i8}, but not for i24 -> {i8, i8, i8}.
219
219
let can_store_through_cast_ptr = false ;
@@ -335,7 +335,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
335
335
if let PassMode :: Indirect { .. } = self . ret . mode { 1 } else { 0 } + args_capacity,
336
336
) ;
337
337
338
- let llreturn_ty = match self . ret . mode {
338
+ let llreturn_ty = match & self . ret . mode {
339
339
PassMode :: Ignore => cx. type_void ( ) ,
340
340
PassMode :: Direct ( _) | PassMode :: Pair ( ..) => self . ret . layout . immediate_llvm_type ( cx) ,
341
341
PassMode :: Cast ( cast) => cast. llvm_type ( cx) ,
@@ -351,7 +351,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
351
351
llargument_tys. push ( ty. llvm_type ( cx) ) ;
352
352
}
353
353
354
- let llarg_ty = match arg. mode {
354
+ let llarg_ty = match & arg. mode {
355
355
PassMode :: Ignore => continue ,
356
356
PassMode :: Direct ( _) => arg. layout . immediate_llvm_type ( cx) ,
357
357
PassMode :: Pair ( ..) => {
@@ -426,11 +426,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
426
426
i += 1 ;
427
427
i - 1
428
428
} ;
429
- match self . ret . mode {
430
- PassMode :: Direct ( ref attrs) => {
429
+ match & self . ret . mode {
430
+ PassMode :: Direct ( attrs) => {
431
431
attrs. apply_attrs_to_llfn ( llvm:: AttributePlace :: ReturnValue , cx, llfn) ;
432
432
}
433
- PassMode :: Indirect { ref attrs, extra_attrs : _, on_stack } => {
433
+ PassMode :: Indirect { attrs, extra_attrs : _, on_stack } => {
434
434
assert ! ( !on_stack) ;
435
435
let i = apply ( attrs) ;
436
436
let sret = llvm:: CreateStructRetAttr ( cx. llcx , self . ret . layout . llvm_type ( cx) ) ;
@@ -445,23 +445,23 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
445
445
if arg. pad . is_some ( ) {
446
446
apply ( & ArgAttributes :: new ( ) ) ;
447
447
}
448
- match arg. mode {
448
+ match & arg. mode {
449
449
PassMode :: Ignore => { }
450
- PassMode :: Indirect { ref attrs, extra_attrs : None , on_stack : true } => {
450
+ PassMode :: Indirect { attrs, extra_attrs : None , on_stack : true } => {
451
451
let i = apply ( attrs) ;
452
452
let byval = llvm:: CreateByValAttr ( cx. llcx , arg. layout . llvm_type ( cx) ) ;
453
453
attributes:: apply_to_llfn ( llfn, llvm:: AttributePlace :: Argument ( i) , & [ byval] ) ;
454
454
}
455
- PassMode :: Direct ( ref attrs)
456
- | PassMode :: Indirect { ref attrs, extra_attrs : None , on_stack : false } => {
455
+ PassMode :: Direct ( attrs)
456
+ | PassMode :: Indirect { attrs, extra_attrs : None , on_stack : false } => {
457
457
apply ( attrs) ;
458
458
}
459
- PassMode :: Indirect { ref attrs, extra_attrs : Some ( ref extra_attrs) , on_stack } => {
459
+ PassMode :: Indirect { attrs, extra_attrs : Some ( extra_attrs) , on_stack } => {
460
460
assert ! ( !on_stack) ;
461
461
apply ( attrs) ;
462
462
apply ( extra_attrs) ;
463
463
}
464
- PassMode :: Pair ( ref a , ref b) => {
464
+ PassMode :: Pair ( a , b) => {
465
465
apply ( a) ;
466
466
apply ( b) ;
467
467
}
@@ -488,11 +488,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
488
488
i += 1 ;
489
489
i - 1
490
490
} ;
491
- match self . ret . mode {
492
- PassMode :: Direct ( ref attrs) => {
491
+ match & self . ret . mode {
492
+ PassMode :: Direct ( attrs) => {
493
493
attrs. apply_attrs_to_callsite ( llvm:: AttributePlace :: ReturnValue , bx. cx , callsite) ;
494
494
}
495
- PassMode :: Indirect { ref attrs, extra_attrs : _, on_stack } => {
495
+ PassMode :: Indirect { attrs, extra_attrs : _, on_stack } => {
496
496
assert ! ( !on_stack) ;
497
497
let i = apply ( bx. cx , attrs) ;
498
498
let sret = llvm:: CreateStructRetAttr ( bx. cx . llcx , self . ret . layout . llvm_type ( bx) ) ;
@@ -521,9 +521,9 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
521
521
if arg. pad . is_some ( ) {
522
522
apply ( bx. cx , & ArgAttributes :: new ( ) ) ;
523
523
}
524
- match arg. mode {
524
+ match & arg. mode {
525
525
PassMode :: Ignore => { }
526
- PassMode :: Indirect { ref attrs, extra_attrs : None , on_stack : true } => {
526
+ PassMode :: Indirect { attrs, extra_attrs : None , on_stack : true } => {
527
527
let i = apply ( bx. cx , attrs) ;
528
528
let byval = llvm:: CreateByValAttr ( bx. cx . llcx , arg. layout . llvm_type ( bx) ) ;
529
529
attributes:: apply_to_callsite (
@@ -532,19 +532,15 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
532
532
& [ byval] ,
533
533
) ;
534
534
}
535
- PassMode :: Direct ( ref attrs)
536
- | PassMode :: Indirect { ref attrs, extra_attrs : None , on_stack : false } => {
535
+ PassMode :: Direct ( attrs)
536
+ | PassMode :: Indirect { attrs, extra_attrs : None , on_stack : false } => {
537
537
apply ( bx. cx , attrs) ;
538
538
}
539
- PassMode :: Indirect {
540
- ref attrs,
541
- extra_attrs : Some ( ref extra_attrs) ,
542
- on_stack : _,
543
- } => {
539
+ PassMode :: Indirect { attrs, extra_attrs : Some ( extra_attrs) , on_stack : _ } => {
544
540
apply ( bx. cx , attrs) ;
545
541
apply ( bx. cx , extra_attrs) ;
546
542
}
547
- PassMode :: Pair ( ref a , ref b) => {
543
+ PassMode :: Pair ( a , b) => {
548
544
apply ( bx. cx , a) ;
549
545
apply ( bx. cx , b) ;
550
546
}
0 commit comments