@@ -194,6 +194,7 @@ impl TargetDataLayout {
194194 /// to represent object size in bits. It would need to be 1 << 61 to account for this, but is
195195 /// currently conservatively bounded to 1 << 47 as that is enough to cover the current usable
196196 /// address space on 64-bit ARMv8 and x86_64.
197+ #[ inline]
197198 pub fn obj_size_bound ( & self ) -> u64 {
198199 match self . pointer_size . bits ( ) {
199200 16 => 1 << 15 ,
@@ -203,6 +204,7 @@ impl TargetDataLayout {
203204 }
204205 }
205206
207+ #[ inline]
206208 pub fn ptr_sized_integer ( & self ) -> Integer {
207209 match self . pointer_size . bits ( ) {
208210 16 => I16 ,
@@ -212,6 +214,7 @@ impl TargetDataLayout {
212214 }
213215 }
214216
217+ #[ inline]
215218 pub fn vector_align ( & self , vec_size : Size ) -> AbiAndPrefAlign {
216219 for & ( size, align) in & self . vector_align {
217220 if size == vec_size {
@@ -562,14 +565,17 @@ pub struct AbiAndPrefAlign {
562565}
563566
564567impl AbiAndPrefAlign {
568+ #[ inline]
565569 pub fn new ( align : Align ) -> AbiAndPrefAlign {
566570 AbiAndPrefAlign { abi : align, pref : align }
567571 }
568572
573+ #[ inline]
569574 pub fn min ( self , other : AbiAndPrefAlign ) -> AbiAndPrefAlign {
570575 AbiAndPrefAlign { abi : self . abi . min ( other. abi ) , pref : self . pref . min ( other. pref ) }
571576 }
572577
578+ #[ inline]
573579 pub fn max ( self , other : AbiAndPrefAlign ) -> AbiAndPrefAlign {
574580 AbiAndPrefAlign { abi : self . abi . max ( other. abi ) , pref : self . pref . max ( other. pref ) }
575581 }
@@ -586,6 +592,7 @@ pub enum Integer {
586592}
587593
588594impl Integer {
595+ #[ inline]
589596 pub fn size ( self ) -> Size {
590597 match self {
591598 I8 => Size :: from_bytes ( 1 ) ,
@@ -609,6 +616,7 @@ impl Integer {
609616 }
610617
611618 /// Finds the smallest Integer type which can represent the signed value.
619+ #[ inline]
612620 pub fn fit_signed ( x : i128 ) -> Integer {
613621 match x {
614622 -0x0000_0000_0000_0080 ..=0x0000_0000_0000_007f => I8 ,
@@ -620,6 +628,7 @@ impl Integer {
620628 }
621629
622630 /// Finds the smallest Integer type which can represent the unsigned value.
631+ #[ inline]
623632 pub fn fit_unsigned ( x : u128 ) -> Integer {
624633 match x {
625634 0 ..=0x0000_0000_0000_00ff => I8 ,
@@ -655,6 +664,9 @@ impl Integer {
655664 I8
656665 }
657666
667+ // FIXME(eddyb) consolidate this and other methods that find the appropriate
668+ // `Integer` given some requirements.
669+ #[ inline]
658670 fn from_size ( size : Size ) -> Result < Self , String > {
659671 match size. bits ( ) {
660672 8 => Ok ( Integer :: I8 ) ,
@@ -706,10 +718,14 @@ impl Primitive {
706718 }
707719 }
708720
721+ // FIXME(eddyb) remove, it's trivial thanks to `matches!`.
722+ #[ inline]
709723 pub fn is_float ( self ) -> bool {
710724 matches ! ( self , F32 | F64 )
711725 }
712726
727+ // FIXME(eddyb) remove, it's completely unused.
728+ #[ inline]
713729 pub fn is_int ( self ) -> bool {
714730 matches ! ( self , Int ( ..) )
715731 }
@@ -786,6 +802,7 @@ pub struct Scalar {
786802}
787803
788804impl Scalar {
805+ #[ inline]
789806 pub fn is_bool ( & self ) -> bool {
790807 matches ! ( self . value, Int ( I8 , false ) )
791808 && matches ! ( self . valid_range, WrappingRange { start: 0 , end: 1 } )
@@ -852,6 +869,7 @@ pub enum FieldsShape {
852869}
853870
854871impl FieldsShape {
872+ #[ inline]
855873 pub fn count ( & self ) -> usize {
856874 match * self {
857875 FieldsShape :: Primitive => 0 ,
@@ -861,6 +879,7 @@ impl FieldsShape {
861879 }
862880 }
863881
882+ #[ inline]
864883 pub fn offset ( & self , i : usize ) -> Size {
865884 match * self {
866885 FieldsShape :: Primitive => {
@@ -884,6 +903,7 @@ impl FieldsShape {
884903 }
885904 }
886905
906+ #[ inline]
887907 pub fn memory_index ( & self , i : usize ) -> usize {
888908 match * self {
889909 FieldsShape :: Primitive => {
@@ -967,6 +987,7 @@ impl Abi {
967987 }
968988
969989 /// Returns `true` if this is a single signed integer scalar
990+ #[ inline]
970991 pub fn is_signed ( & self ) -> bool {
971992 match * self {
972993 Abi :: Scalar ( ref scal) => match scal. value {
0 commit comments