1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 use super::backend::Backend;
13 pub trait TypeMethods : Backend {
14 fn void(&self) -> Self::Type;
15 fn metadata(&self) -> Self::Type;
16 fn i1(&self) -> Self::Type;
17 fn i8(&self) -> Self::Type;
18 fn i16(&self) -> Self::Type;
19 fn i32(&self) -> Self::Type;
20 fn i64(&self) -> Self::Type;
21 fn i128(&self) -> Self::Type;
22 fn ix(&self, num_bites: u64) -> Self::Type;
23 fn f32(&self) -> Self::Type;
24 fn f64(&self) -> Self::Type;
25 fn x86_mmx(&self) -> Self::Type;
27 fn func(&self, args: &[Self::Type], ret: Self::Type) -> Self::Type;
28 fn variadic_func(&self, args: &[Self::Type], ret: Self::Type) -> Self::Type;
29 fn struct_(&self, els: &[Self::Type], packed: bool) -> Self::Type;
30 fn named_struct(&self, name: &str) -> Self::Type;
31 fn array(&self, ty: Self::Type, len: u64) -> Self::Type;
32 fn vector(&self, ty: Self::Type, len: u64) -> Self::Type;
33 fn kind(&self, ty: Self::Type) -> Self::TypeKind;
34 fn set_struct_body(&self, ty: Self::Type, els: &[Self::Type], packed: bool);
35 fn ptr_to(&self, ty: Self::Type) -> Self::Type;
36 fn element_type(&self, ty: Self::Type) -> Self::Type;
37 fn vector_length(&self, ty: Self::Type) -> usize;
38 fn func_params(&self, ty: Self::Type) -> Vec<Self::Type>;
39 fn float_width(&self, ty: Self::Type) -> usize;
40 fn int_width(&self, ty: Self::Type) -> u64;