@@ -141,6 +141,23 @@ impl CodegenCx<'ll, 'tcx> {
141141 assert_eq ! ( size % unit_size, 0 ) ;
142142 self . type_array ( self . type_from_integer ( unit) , size / unit_size)
143143 }
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+ }
144161}
145162
146163impl BaseTypeMethods < ' tcx > for CodegenCx < ' ll , ' tcx > {
@@ -208,17 +225,6 @@ impl BaseTypeMethods<'tcx> for CodegenCx<'ll, 'tcx> {
208225 }
209226 }
210227
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-
222228 fn type_struct (
223229 & self ,
224230 els : & [ & ' ll Type ] ,
@@ -231,13 +237,6 @@ impl BaseTypeMethods<'tcx> for CodegenCx<'ll, 'tcx> {
231237 }
232238 }
233239
234-
235- fn type_array ( & self , ty : & ' ll Type , len : u64 ) -> & ' ll Type {
236- unsafe {
237- llvm:: LLVMRustArrayType ( ty, len)
238- }
239- }
240-
241240 fn type_kind ( & self , ty : & ' ll Type ) -> TypeKind {
242241 unsafe {
243242 llvm:: LLVMRustGetTypeKind ( ty) . to_generic ( )
0 commit comments