@@ -2,19 +2,18 @@ use std::borrow::Borrow;
22use std:: cmp;
33
44use libc:: c_uint;
5- use rustc_abi as abi;
6- pub ( crate ) use rustc_abi:: ExternAbi ;
7- use rustc_abi:: { HasDataLayout , Primitive , Reg , RegKind , Size } ;
5+ use rustc_abi:: { BackendRepr , HasDataLayout , Primitive , Reg , RegKind , Size } ;
86use rustc_codegen_ssa:: MemFlags ;
97use rustc_codegen_ssa:: mir:: operand:: { OperandRef , OperandValue } ;
108use rustc_codegen_ssa:: mir:: place:: { PlaceRef , PlaceValue } ;
119use rustc_codegen_ssa:: traits:: * ;
1210use rustc_middle:: ty:: Ty ;
1311use rustc_middle:: ty:: layout:: LayoutOf ;
14- pub ( crate ) use rustc_middle:: ty:: layout:: { WIDE_PTR_ADDR , WIDE_PTR_EXTRA } ;
1512use rustc_middle:: { bug, ty} ;
1613use rustc_session:: config;
17- pub ( crate ) use rustc_target:: callconv:: * ;
14+ use rustc_target:: callconv:: {
15+ ArgAbi , ArgAttribute , ArgAttributes , ArgExtension , CastTarget , Conv , FnAbi , PassMode ,
16+ } ;
1817use rustc_target:: spec:: SanitizerSet ;
1918use smallvec:: SmallVec ;
2019
@@ -458,7 +457,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
458457 match & self . ret . mode {
459458 PassMode :: Direct ( attrs) => {
460459 attrs. apply_attrs_to_llfn ( llvm:: AttributePlace :: ReturnValue , cx, llfn) ;
461- if let abi :: BackendRepr :: Scalar ( scalar) = self . ret . layout . backend_repr {
460+ if let BackendRepr :: Scalar ( scalar) = self . ret . layout . backend_repr {
462461 apply_range_attr ( llvm:: AttributePlace :: ReturnValue , scalar) ;
463462 }
464463 }
@@ -499,7 +498,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
499498 }
500499 PassMode :: Direct ( attrs) => {
501500 let i = apply ( attrs) ;
502- if let abi :: BackendRepr :: Scalar ( scalar) = arg. layout . backend_repr {
501+ if let BackendRepr :: Scalar ( scalar) = arg. layout . backend_repr {
503502 apply_range_attr ( llvm:: AttributePlace :: Argument ( i) , scalar) ;
504503 }
505504 }
@@ -514,9 +513,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
514513 PassMode :: Pair ( a, b) => {
515514 let i = apply ( a) ;
516515 let ii = apply ( b) ;
517- if let abi:: BackendRepr :: ScalarPair ( scalar_a, scalar_b) =
518- arg. layout . backend_repr
519- {
516+ if let BackendRepr :: ScalarPair ( scalar_a, scalar_b) = arg. layout . backend_repr {
520517 apply_range_attr ( llvm:: AttributePlace :: Argument ( i) , scalar_a) ;
521518 apply_range_attr ( llvm:: AttributePlace :: Argument ( ii) , scalar_b) ;
522519 }
@@ -576,7 +573,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
576573 }
577574 if bx. cx . sess ( ) . opts . optimize != config:: OptLevel :: No
578575 && llvm_util:: get_version ( ) < ( 19 , 0 , 0 )
579- && let abi :: BackendRepr :: Scalar ( scalar) = self . ret . layout . backend_repr
576+ && let BackendRepr :: Scalar ( scalar) = self . ret . layout . backend_repr
580577 && matches ! ( scalar. primitive( ) , Primitive :: Int ( ..) )
581578 // If the value is a boolean, the range is 0..2 and that ultimately
582579 // become 0..0 when the type becomes i1, which would be rejected
0 commit comments