Skip to content

Commit e19c4b9

Browse files
committed
Remove type_variadic_func and typ_array from cg_ssa
1 parent d163582 commit e19c4b9

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

src/librustc_codegen_llvm/type_.rs

+17-18
Original file line numberDiff line numberDiff line change
@@ -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

146163
impl 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()

src/librustc_codegen_ssa/traits/type_.rs

-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ pub trait BaseTypeMethods<'tcx>: Backend<'tcx> {
2323
fn type_f64(&self) -> Self::Type;
2424

2525
fn type_func(&self, args: &[Self::Type], ret: Self::Type) -> Self::Type;
26-
fn type_variadic_func(&self, args: &[Self::Type], ret: Self::Type) -> Self::Type;
2726
fn type_struct(&self, els: &[Self::Type], packed: bool) -> Self::Type;
28-
fn type_array(&self, ty: Self::Type, len: u64) -> Self::Type;
2927
fn type_kind(&self, ty: Self::Type) -> TypeKind;
3028
fn type_ptr_to(&self, ty: Self::Type) -> Self::Type;
3129
fn element_type(&self, ty: Self::Type) -> Self::Type;

0 commit comments

Comments
 (0)