@@ -21,17 +21,17 @@ use middle::trans::type_::Type;
21
21
// compute sizeof / alignof
22
22
23
23
// 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 {
25
25
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 ;
27
27
}
28
28
}
29
29
30
30
// Returns the number of bytes between successive elements of type T in an
31
31
// 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 {
33
33
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 ;
35
35
}
36
36
}
37
37
@@ -43,22 +43,22 @@ pub fn llsize_of_alloc(cx: &CrateContext, ty: Type) -> uint {
43
43
// that LLVM *does* distinguish between e.g. a 1-bit value and an 8-bit value
44
44
// at the codegen level! In general you should prefer `llbitsize_of_real`
45
45
// below.
46
- pub fn llsize_of_real ( cx : & CrateContext , ty : Type ) -> uint {
46
+ pub fn llsize_of_real ( cx : & CrateContext , ty : Type ) -> u64 {
47
47
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 {
50
50
// Not an even number of bytes, spills into "next" byte.
51
- 1 u + ( nbits >> 3 )
51
+ 1 + ( nbits >> 3 )
52
52
} else {
53
53
nbits >> 3
54
54
}
55
55
}
56
56
}
57
57
58
58
/// 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 {
60
60
unsafe {
61
- llvm:: LLVMSizeOfTypeInBits ( cx. td . lltd , ty. to_ref ( ) ) as uint
61
+ llvm:: LLVMSizeOfTypeInBits ( cx. td . lltd , ty. to_ref ( ) ) as u64
62
62
}
63
63
}
64
64
@@ -71,7 +71,7 @@ pub fn llsize_of(cx: &CrateContext, ty: Type) -> ValueRef {
71
71
// there's no need for that contrivance. The instruction
72
72
// selection DAG generator would flatten that GEP(1) node into a
73
73
// 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 ) ;
75
75
}
76
76
77
77
// 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 {
89
89
// The preferred alignment may be larger than the alignment used when
90
90
// packing the type into structs. This will be used for things like
91
91
// 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 {
93
93
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 ;
95
95
}
96
96
}
97
97
98
98
// Returns the minimum alignment of a type required by the platform.
99
99
// This is the alignment that will be used for struct fields, arrays,
100
100
// 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 {
102
102
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 ;
104
104
}
105
105
}
106
106
@@ -114,8 +114,8 @@ pub fn llalign_of(cx: &CrateContext, ty: Type) -> ValueRef {
114
114
}
115
115
}
116
116
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 {
118
118
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 ;
120
120
}
121
121
}
0 commit comments