middle: trans: type_: remove dead code
This commit is contained in:
parent
53b70a83c6
commit
b4653941d6
@ -20,7 +20,6 @@ use syntax::abi::{X86, X86_64, Arm, Mips};
|
|||||||
|
|
||||||
use std::c_str::ToCStr;
|
use std::c_str::ToCStr;
|
||||||
use std::cast;
|
use std::cast;
|
||||||
use std::slice;
|
|
||||||
|
|
||||||
use std::libc::{c_uint};
|
use std::libc::{c_uint};
|
||||||
|
|
||||||
@ -135,10 +134,6 @@ impl Type {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn size_t(ccx: &CrateContext) -> Type {
|
|
||||||
Type::int(ccx)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn func(args: &[Type], ret: &Type) -> Type {
|
pub fn func(args: &[Type], ret: &Type) -> Type {
|
||||||
let vec : &[TypeRef] = unsafe { cast::transmute(args) };
|
let vec : &[TypeRef] = unsafe { cast::transmute(args) };
|
||||||
ty!(llvm::LLVMFunctionType(ret.to_ref(), vec.as_ptr(),
|
ty!(llvm::LLVMFunctionType(ret.to_ref(), vec.as_ptr(),
|
||||||
@ -151,10 +146,6 @@ impl Type {
|
|||||||
args.len() as c_uint, True))
|
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 {
|
pub fn struct_(ccx: &CrateContext, els: &[Type], packed: bool) -> Type {
|
||||||
let els : &[TypeRef] = unsafe { cast::transmute(els) };
|
let els : &[TypeRef] = unsafe { cast::transmute(els) };
|
||||||
ty!(llvm::LLVMStructTypeInContext(ccx.llcx, els.as_ptr(),
|
ty!(llvm::LLVMStructTypeInContext(ccx.llcx, els.as_ptr(),
|
||||||
@ -259,17 +250,6 @@ impl Type {
|
|||||||
ty!(llvm::LLVMPointerType(self.to_ref(), 0))
|
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 {
|
pub fn is_packed(&self) -> bool {
|
||||||
unsafe {
|
unsafe {
|
||||||
llvm::LLVMIsPackedStruct(self.to_ref()) == True
|
llvm::LLVMIsPackedStruct(self.to_ref()) == True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user