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()))
}
}
- 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;
}
}
- 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;
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.")
- }
- }
}