]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_trans/type_.rs
rustc: Remove some dead code
[rust.git] / src / librustc_trans / type_.rs
index d70afc0cce5a3cbebfa7ff9bc997b53b0b5137c2..b8a8068d36af7ef33f59a467410525be44cac9ca 100644 (file)
@@ -237,19 +237,6 @@ pub fn ptr_to(&self) -> Type {
         ty!(llvm::LLVMPointerType(self.to_ref(), 0))
     }
 
-    pub fn is_aggregate(&self) -> bool {
-        match self.kind() {
-            TypeKind::Struct | TypeKind::Array => true,
-            _ =>  false
-        }
-    }
-
-    pub fn is_packed(&self) -> bool {
-        unsafe {
-            llvm::LLVMIsPackedStruct(self.to_ref()) == True
-        }
-    }
-
     pub fn element_type(&self) -> Type {
         unsafe {
             Type::from_ref(llvm::LLVMGetElementType(self.to_ref()))
@@ -263,12 +250,6 @@ pub fn vector_length(&self) -> usize {
         }
     }
 
-    pub fn array_length(&self) -> usize {
-        unsafe {
-            llvm::LLVMGetArrayLength(self.to_ref()) as usize
-        }
-    }
-
     pub fn field_types(&self) -> Vec<Type> {
         unsafe {
             let n_elts = llvm::LLVMCountStructElementTypes(self.to_ref()) as usize;
@@ -282,10 +263,6 @@ pub fn field_types(&self) -> Vec<Type> {
         }
     }
 
-    pub fn return_type(&self) -> Type {
-        ty!(llvm::LLVMGetReturnType(self.to_ref()))
-    }
-
     pub fn func_params(&self) -> Vec<Type> {
         unsafe {
             let n_args = llvm::LLVMCountParamTypes(self.to_ref()) as usize;
@@ -324,13 +301,4 @@ pub fn from_integer(cx: &CrateContext, i: layout::Integer) -> Type {
             I128 => Type::i128(cx),
         }
     }
-
-    pub fn from_primitive(ccx: &CrateContext, p: layout::Primitive) -> Type {
-        match p {
-            layout::Int(i) => Type::from_integer(ccx, i),
-            layout::F32 => Type::f32(ccx),
-            layout::F64 => Type::f64(ccx),
-            layout::Pointer => bug!("It is not possible to convert Pointer directly to Type.")
-        }
-    }
 }