@@ -141,6 +141,23 @@ impl CodegenCx<'ll, 'tcx> {
141
141
assert_eq ! ( size % unit_size, 0 ) ;
142
142
self . type_array ( self . type_from_integer ( unit) , size / unit_size)
143
143
}
144
+
145
+ crate fn type_variadic_func (
146
+ & self ,
147
+ args : & [ & ' ll Type ] ,
148
+ ret : & ' ll Type
149
+ ) -> & ' ll Type {
150
+ unsafe {
151
+ llvm:: LLVMFunctionType ( ret, args. as_ptr ( ) ,
152
+ args. len ( ) as c_uint , True )
153
+ }
154
+ }
155
+
156
+ crate fn type_array ( & self , ty : & ' ll Type , len : u64 ) -> & ' ll Type {
157
+ unsafe {
158
+ llvm:: LLVMRustArrayType ( ty, len)
159
+ }
160
+ }
144
161
}
145
162
146
163
impl BaseTypeMethods < ' tcx > for CodegenCx < ' ll , ' tcx > {
@@ -208,17 +225,6 @@ impl BaseTypeMethods<'tcx> for CodegenCx<'ll, 'tcx> {
208
225
}
209
226
}
210
227
211
- fn type_variadic_func (
212
- & self ,
213
- args : & [ & ' ll Type ] ,
214
- ret : & ' ll Type
215
- ) -> & ' ll Type {
216
- unsafe {
217
- llvm:: LLVMFunctionType ( ret, args. as_ptr ( ) ,
218
- args. len ( ) as c_uint , True )
219
- }
220
- }
221
-
222
228
fn type_struct (
223
229
& self ,
224
230
els : & [ & ' ll Type ] ,
@@ -231,13 +237,6 @@ impl BaseTypeMethods<'tcx> for CodegenCx<'ll, 'tcx> {
231
237
}
232
238
}
233
239
234
-
235
- fn type_array ( & self , ty : & ' ll Type , len : u64 ) -> & ' ll Type {
236
- unsafe {
237
- llvm:: LLVMRustArrayType ( ty, len)
238
- }
239
- }
240
-
241
240
fn type_kind ( & self , ty : & ' ll Type ) -> TypeKind {
242
241
unsafe {
243
242
llvm:: LLVMRustGetTypeKind ( ty) . to_generic ( )
0 commit comments