middle: trans: type_: remove dead code

This commit is contained in:
Corey Richardson 2014-04-01 10:37:12 -04:00
parent 53b70a83c6
commit b4653941d6

View File

@ -20,7 +20,6 @@
use std::c_str::ToCStr;
use std::cast;
use std::slice;
use std::libc::{c_uint};
@ -135,10 +134,6 @@ pub fn float_from_ty(ccx: &CrateContext, t: ast::FloatTy) -> Type {
}
}
pub fn size_t(ccx: &CrateContext) -> Type {
Type::int(ccx)
}
pub fn func(args: &[Type], ret: &Type) -> Type {
let vec : &[TypeRef] = unsafe { cast::transmute(args) };
ty!(llvm::LLVMFunctionType(ret.to_ref(), vec.as_ptr(),
@ -151,10 +146,6 @@ pub fn variadic_func(args: &[Type], ret: &Type) -> Type {
args.len() as c_uint, True))
}
pub fn ptr(ty: Type) -> Type {
ty!(llvm::LLVMPointerType(ty.to_ref(), 0 as c_uint))
}
pub fn struct_(ccx: &CrateContext, els: &[Type], packed: bool) -> Type {
let els : &[TypeRef] = unsafe { cast::transmute(els) };
ty!(llvm::LLVMStructTypeInContext(ccx.llcx, els.as_ptr(),
@ -259,17 +250,6 @@ pub fn ptr_to(&self) -> Type {
ty!(llvm::LLVMPointerType(self.to_ref(), 0))
}
pub fn get_field(&self, idx: uint) -> Type {
unsafe {
let num_fields = llvm::LLVMCountStructElementTypes(self.to_ref()) as uint;
let mut elems = slice::from_elem(num_fields, 0 as TypeRef);
llvm::LLVMGetStructElementTypes(self.to_ref(), elems.as_mut_ptr());
Type::from_ref(elems[idx])
}
}
pub fn is_packed(&self) -> bool {
unsafe {
llvm::LLVMIsPackedStruct(self.to_ref()) == True