@@ -126,25 +126,14 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
126
126
unsafe { llvm:: LLVMGetPoison ( t) }
127
127
}
128
128
129
- fn const_int ( & self , t : & ' ll Type , i : i64 ) -> & ' ll Value {
130
- unsafe { llvm:: LLVMConstInt ( t, i as u64 , True ) }
131
- }
132
-
133
- fn const_uint ( & self , t : & ' ll Type , i : u64 ) -> & ' ll Value {
134
- unsafe { llvm:: LLVMConstInt ( t, i, False ) }
135
- }
136
-
137
- fn const_uint_big ( & self , t : & ' ll Type , u : u128 ) -> & ' ll Value {
138
- unsafe {
139
- let words = [ u as u64 , ( u >> 64 ) as u64 ] ;
140
- llvm:: LLVMConstIntOfArbitraryPrecision ( t, 2 , words. as_ptr ( ) )
141
- }
142
- }
143
-
144
129
fn const_bool ( & self , val : bool ) -> & ' ll Value {
145
130
self . const_uint ( self . type_i1 ( ) , val as u64 )
146
131
}
147
132
133
+ fn const_i8 ( & self , i : i8 ) -> & ' ll Value {
134
+ self . const_int ( self . type_i8 ( ) , i as i64 )
135
+ }
136
+
148
137
fn const_i16 ( & self , i : i16 ) -> & ' ll Value {
149
138
self . const_int ( self . type_i16 ( ) , i as i64 )
150
139
}
@@ -153,8 +142,12 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
153
142
self . const_int ( self . type_i32 ( ) , i as i64 )
154
143
}
155
144
156
- fn const_i8 ( & self , i : i8 ) -> & ' ll Value {
157
- self . const_int ( self . type_i8 ( ) , i as i64 )
145
+ fn const_int ( & self , t : & ' ll Type , i : i64 ) -> & ' ll Value {
146
+ unsafe { llvm:: LLVMConstInt ( t, i as u64 , True ) }
147
+ }
148
+
149
+ fn const_u8 ( & self , i : u8 ) -> & ' ll Value {
150
+ self . const_uint ( self . type_i8 ( ) , i as u64 )
158
151
}
159
152
160
153
fn const_u32 ( & self , i : u32 ) -> & ' ll Value {
@@ -179,8 +172,15 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
179
172
self . const_uint ( self . isize_ty , i)
180
173
}
181
174
182
- fn const_u8 ( & self , i : u8 ) -> & ' ll Value {
183
- self . const_uint ( self . type_i8 ( ) , i as u64 )
175
+ fn const_uint ( & self , t : & ' ll Type , i : u64 ) -> & ' ll Value {
176
+ unsafe { llvm:: LLVMConstInt ( t, i, False ) }
177
+ }
178
+
179
+ fn const_uint_big ( & self , t : & ' ll Type , u : u128 ) -> & ' ll Value {
180
+ unsafe {
181
+ let words = [ u as u64 , ( u >> 64 ) as u64 ] ;
182
+ llvm:: LLVMConstIntOfArbitraryPrecision ( t, 2 , words. as_ptr ( ) )
183
+ }
184
184
}
185
185
186
186
fn const_real ( & self , t : & ' ll Type , val : f64 ) -> & ' ll Value {
0 commit comments