[][src]Struct llvm_ir::types::Types

pub struct Types { /* fields omitted */ }

Holds a reference to all of the Types used in the Module, and facilitates lookups so you can get a TypeRef to the Type you want.

Implementations

impl Types[src]

pub fn type_of<T: Typed + ?Sized>(&self, t: &T) -> TypeRef[src]

Get the type of anything that is Typed

pub fn void(&self) -> TypeRef[src]

Get the void type

pub fn int(&self, bits: u32) -> TypeRef[src]

Get the integer type of the specified size (in bits)

pub fn bool(&self) -> TypeRef[src]

Get the boolean type (i1)

pub fn i8(&self) -> TypeRef[src]

Get the 8-bit integer type

pub fn i16(&self) -> TypeRef[src]

Get the 16-bit integer type

pub fn i32(&self) -> TypeRef[src]

Get the 32-bit integer type

pub fn i64(&self) -> TypeRef[src]

Get the 64-bit integer type

pub fn pointer_to(&self, pointee_type: TypeRef) -> TypeRef[src]

Get a pointer type in the default address space (0)

pub fn pointer_in_addr_space(
    &self,
    pointee_type: TypeRef,
    addr_space: AddrSpace
) -> TypeRef
[src]

Get a pointer type in the specified address space

pub fn fp(&self, fpt: FPType) -> TypeRef[src]

Get a floating-point type

pub fn single(&self) -> TypeRef[src]

Get the single-precision floating-point type

pub fn double(&self) -> TypeRef[src]

Get the double-precision floating-point type

pub fn func_type(
    &self,
    result_type: TypeRef,
    param_types: Vec<TypeRef>,
    is_var_arg: bool
) -> TypeRef
[src]

Get a function type

pub fn vector_of(&self, element_type: TypeRef, num_elements: usize) -> TypeRef[src]

Get a vector type

pub fn array_of(&self, element_type: TypeRef, num_elements: usize) -> TypeRef[src]

Get an array type

pub fn struct_of(&self, element_types: Vec<TypeRef>, is_packed: bool) -> TypeRef[src]

Get a struct type

pub fn named_struct(&self, name: &str) -> Option<TypeRef>[src]

Get the TypeRef for the struct with the given name, or None if there is no struct by that name.

Note that this gives a NamedStructType. To get the actual definition of a named struct (the NamedStructDef), use named_struct_def().

pub fn named_struct_def(&self, name: &str) -> Option<&NamedStructDef>[src]

Get the NamedStructDef for the struct with the given name, or None if there is no struct by that name.

Note that this gives a NamedStructDef. To get the NamedStructType for a name, use named_struct().

pub fn all_struct_names(&self) -> impl Iterator<Item = &String>[src]

Get the names of all the named structs

pub fn x86_mmx(&self) -> TypeRef[src]

Get the X86_MMX type

pub fn metadata_type(&self) -> TypeRef[src]

Get the metadata type

pub fn label_type(&self) -> TypeRef[src]

Get the label type

pub fn token_type(&self) -> TypeRef[src]

Get the token type

pub fn get_for_type(&self, ty: &Type) -> TypeRef[src]

Get a TypeRef for the given Type

impl Types[src]

pub fn blank_for_testing() -> Self[src]

Get a blank Types containing essentially no types. This function is intended only for use in testing; it's probably not useful otherwise.

Trait Implementations

impl Clone for Types[src]

Auto Trait Implementations

impl RefUnwindSafe for Types

impl Send for Types

impl Sync for Types

impl Unpin for Types

impl UnwindSafe for Types

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.