@@ -43,14 +43,14 @@ pub(crate) fn readjust_fn_abi<'tcx>(
4343 arg. mode = PassMode :: Ignore ;
4444 }
4545
46- if let TyKind :: Ref ( _, ty, _) = arg. layout . ty . kind ( ) {
47- if matches ! ( ty. kind( ) , TyKind :: Slice ( _) ) {
48- let mut ptr_attrs = ArgAttributes :: new ( ) ;
49- if let PassMode :: Indirect { attrs, .. } = arg. mode {
50- ptr_attrs. regular = attrs. regular ;
51- }
52- arg. mode = PassMode :: Pair ( ptr_attrs, ArgAttributes :: new ( ) ) ;
46+ if let TyKind :: Ref ( _, ty, _) = arg. layout . ty . kind ( )
47+ && matches ! ( ty. kind( ) , TyKind :: Slice ( _) )
48+ {
49+ let mut ptr_attrs = ArgAttributes :: new ( ) ;
50+ if let PassMode :: Indirect { attrs, .. } = arg. mode {
51+ ptr_attrs. regular = attrs. regular ;
5352 }
53+ arg. mode = PassMode :: Pair ( ptr_attrs, ArgAttributes :: new ( ) ) ;
5454 }
5555
5656 if arg. layout . ty . is_array ( ) && !matches ! ( arg. mode, PassMode :: Direct { .. } ) {
@@ -491,11 +491,12 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
491491 // If the value is a boolean, the range is 0..2 and that ultimately
492492 // become 0..0 when the type becomes i1, which would be rejected
493493 // by the LLVM verifier.
494- if let Primitive :: Int ( ..) = scalar. primitive ( ) {
495- if !scalar. is_bool ( ) && !scalar. is_always_valid ( bx) {
496- trace ! ( "apply_attrs_callsite -> range_metadata" ) ;
497- bx. range_metadata ( callsite, scalar. valid_range ( bx) ) ;
498- }
494+ if let Primitive :: Int ( ..) = scalar. primitive ( )
495+ && !scalar. is_bool ( )
496+ && !scalar. is_always_valid ( bx)
497+ {
498+ trace ! ( "apply_attrs_callsite -> range_metadata" ) ;
499+ bx. range_metadata ( callsite, scalar. valid_range ( bx) ) ;
499500 }
500501 }
501502 for arg in self . args . iter ( ) {
@@ -549,11 +550,11 @@ impl<'tcx> AbiBuilderMethods for Builder<'_, '_, 'tcx> {
549550 // destructure so rustc doesnt complain in the call to transmute_llval
550551 let Self { cx, llbuilder } = self ;
551552 let map = cx. remapped_integer_args . borrow ( ) ;
552- if let Some ( ( _, key) ) = map. get ( & llfnty) {
553- if let Some ( ( _, new_ty) ) = key. iter ( ) . find ( |t| t. 0 == index) {
554- trace ! ( "Casting irregular param {:?} to {:?}" , val , new_ty ) ;
555- return transmute_llval ( llbuilder , cx , val, new_ty) ;
556- }
553+ if let Some ( ( _, key) ) = map. get ( & llfnty)
554+ && let Some ( ( _, new_ty) ) = key. iter ( ) . find ( |t| t. 0 == index)
555+ {
556+ trace ! ( "Casting irregular param {:?} to {:?}" , val, new_ty) ;
557+ return transmute_llval ( llbuilder , cx , val , new_ty ) ;
557558 }
558559 val
559560 } ;
0 commit comments