@@ -21,17 +21,17 @@ use middle::trans::type_::Type;
2121// compute sizeof / alignof
2222
2323// Returns the number of bytes clobbered by a Store to this type.
24- pub fn llsize_of_store ( cx : & CrateContext , ty : Type ) -> uint {
24+ pub fn llsize_of_store ( cx : & CrateContext , ty : Type ) -> u64 {
2525 unsafe {
26- return llvm:: LLVMStoreSizeOfType ( cx. td . lltd , ty. to_ref ( ) ) as uint ;
26+ return llvm:: LLVMStoreSizeOfType ( cx. td . lltd , ty. to_ref ( ) ) as u64 ;
2727 }
2828}
2929
3030// Returns the number of bytes between successive elements of type T in an
3131// array of T. This is the "ABI" size. It includes any ABI-mandated padding.
32- pub fn llsize_of_alloc ( cx : & CrateContext , ty : Type ) -> uint {
32+ pub fn llsize_of_alloc ( cx : & CrateContext , ty : Type ) -> u64 {
3333 unsafe {
34- return llvm:: LLVMABISizeOfType ( cx. td . lltd , ty. to_ref ( ) ) as uint ;
34+ return llvm:: LLVMABISizeOfType ( cx. td . lltd , ty. to_ref ( ) ) as u64 ;
3535 }
3636}
3737
@@ -43,22 +43,22 @@ pub fn llsize_of_alloc(cx: &CrateContext, ty: Type) -> uint {
4343// that LLVM *does* distinguish between e.g. a 1-bit value and an 8-bit value
4444// at the codegen level! In general you should prefer `llbitsize_of_real`
4545// below.
46- pub fn llsize_of_real ( cx : & CrateContext , ty : Type ) -> uint {
46+ pub fn llsize_of_real ( cx : & CrateContext , ty : Type ) -> u64 {
4747 unsafe {
48- let nbits = llvm:: LLVMSizeOfTypeInBits ( cx. td . lltd , ty. to_ref ( ) ) as uint ;
49- if nbits & 7 u != 0 u {
48+ let nbits = llvm:: LLVMSizeOfTypeInBits ( cx. td . lltd , ty. to_ref ( ) ) as u64 ;
49+ if nbits & 7 != 0 {
5050 // Not an even number of bytes, spills into "next" byte.
51- 1 u + ( nbits >> 3 )
51+ 1 + ( nbits >> 3 )
5252 } else {
5353 nbits >> 3
5454 }
5555 }
5656}
5757
5858/// Returns the "real" size of the type in bits.
59- pub fn llbitsize_of_real ( cx : & CrateContext , ty : Type ) -> uint {
59+ pub fn llbitsize_of_real ( cx : & CrateContext , ty : Type ) -> u64 {
6060 unsafe {
61- llvm:: LLVMSizeOfTypeInBits ( cx. td . lltd , ty. to_ref ( ) ) as uint
61+ llvm:: LLVMSizeOfTypeInBits ( cx. td . lltd , ty. to_ref ( ) ) as u64
6262 }
6363}
6464
@@ -71,7 +71,7 @@ pub fn llsize_of(cx: &CrateContext, ty: Type) -> ValueRef {
7171 // there's no need for that contrivance. The instruction
7272 // selection DAG generator would flatten that GEP(1) node into a
7373 // constant of the type's alloc size, so let's save it some work.
74- return C_uint ( cx, llsize_of_alloc ( cx, ty) ) ;
74+ return C_uint ( cx, llsize_of_alloc ( cx, ty) as uint ) ;
7575}
7676
7777// Returns the "default" size of t (see above), or 1 if the size would
@@ -89,18 +89,18 @@ pub fn nonzero_llsize_of(cx: &CrateContext, ty: Type) -> ValueRef {
8989// The preferred alignment may be larger than the alignment used when
9090// packing the type into structs. This will be used for things like
9191// allocations inside a stack frame, which LLVM has a free hand in.
92- pub fn llalign_of_pref ( cx : & CrateContext , ty : Type ) -> uint {
92+ pub fn llalign_of_pref ( cx : & CrateContext , ty : Type ) -> u64 {
9393 unsafe {
94- return llvm:: LLVMPreferredAlignmentOfType ( cx. td . lltd , ty. to_ref ( ) ) as uint ;
94+ return llvm:: LLVMPreferredAlignmentOfType ( cx. td . lltd , ty. to_ref ( ) ) as u64 ;
9595 }
9696}
9797
9898// Returns the minimum alignment of a type required by the platform.
9999// This is the alignment that will be used for struct fields, arrays,
100100// and similar ABI-mandated things.
101- pub fn llalign_of_min ( cx : & CrateContext , ty : Type ) -> uint {
101+ pub fn llalign_of_min ( cx : & CrateContext , ty : Type ) -> u64 {
102102 unsafe {
103- return llvm:: LLVMABIAlignmentOfType ( cx. td . lltd , ty. to_ref ( ) ) as uint ;
103+ return llvm:: LLVMABIAlignmentOfType ( cx. td . lltd , ty. to_ref ( ) ) as u64 ;
104104 }
105105}
106106
@@ -114,8 +114,8 @@ pub fn llalign_of(cx: &CrateContext, ty: Type) -> ValueRef {
114114 }
115115}
116116
117- pub fn llelement_offset ( cx : & CrateContext , struct_ty : Type , element : uint ) -> uint {
117+ pub fn llelement_offset ( cx : & CrateContext , struct_ty : Type , element : uint ) -> u64 {
118118 unsafe {
119- return llvm:: LLVMOffsetOfElement ( cx. td . lltd , struct_ty. to_ref ( ) , element as u32 ) as uint ;
119+ return llvm:: LLVMOffsetOfElement ( cx. td . lltd , struct_ty. to_ref ( ) , element as u32 ) as u64 ;
120120 }
121121}
0 commit comments