[][src]Enum llvm_ir::types::Type

pub enum Type {
    VoidType,
    IntegerType {
        bits: u32,
    },
    PointerType {
        pointee_type: Box<Type>,
        addr_space: AddrSpace,
    },
    FPType(FPType),
    FuncType {
        result_type: Box<Type>,
        param_types: Vec<Type>,
        is_var_arg: bool,
    },
    VectorType {
        element_type: Box<Type>,
        num_elements: usize,
    },
    ArrayType {
        element_type: Box<Type>,
        num_elements: usize,
    },
    StructType {
        element_types: Vec<Type>,
        is_packed: bool,
    },
    NamedStructType {
        name: String,
        ty: Option<Weak<RwLock<Type>>>,
    },
    X86_MMXType,
    MetadataType,
    LabelType,
    TokenType,
}

Variants

VoidType
IntegerType

Fields of IntegerType

bits: u32
PointerType

Fields of PointerType

pointee_type: Box<Type>addr_space: AddrSpace
FPType(FPType)
FuncType

Fields of FuncType

result_type: Box<Type>param_types: Vec<Type>is_var_arg: bool
VectorType

Vector types (along with integer, FP, pointer, and X86_MMX types) are "first class types", which means they can be produced by instructions (see LLVM 9 docs on First Class Types). See LLVM 9 docs on Vector Type

Fields of VectorType

element_type: Box<Type>num_elements: usize
ArrayType

Struct and Array types (but not vector types) are "aggregate types" and cannot be produced by a single instruction (see LLVM 9 docs on Aggregate Types). See LLVM 9 docs on Array Type

Fields of ArrayType

element_type: Box<Type>num_elements: usize
StructType

The StructType variant is used for a "literal" (i.e., anonymous) structure type. See LLVM 9 docs on Structure Type

Fields of StructType

element_types: Vec<Type>is_packed: bool
NamedStructType

Named structure types. Note that these may be self-referential (i.e., recursive). See LLVM 9 docs on Structure Type

Fields of NamedStructType

name: String

Name of the struct type

ty: Option<Weak<RwLock<Type>>>

The actual struct type, which will be a StructType variant. A None here indicates an opaque type; see LLVM 9 docs on Opaque Structure Types. The weak reference should remain valid for at least the lifetime of the Module in which the named struct type is defined.

X86_MMXType
MetadataType
LabelType

LabelType is the type of BasicBlock labels. See LLVM 9 docs on Label Type

TokenType

Implementations

impl Type[src]

pub fn bool() -> Type[src]

pub fn i8() -> Type[src]

pub fn i16() -> Type[src]

pub fn i32() -> Type[src]

pub fn i64() -> Type[src]

pub fn half() -> Type[src]

pub fn single() -> Type[src]

pub fn double() -> Type[src]

pub fn pointer_to(ty: Type) -> Type[src]

Trait Implementations

impl Clone for Type[src]

impl Debug for Type[src]

impl Eq for Type[src]

impl From<FPType> for Type[src]

impl PartialEq<Type> for Type[src]

impl Typed for Type[src]

Auto Trait Implementations

impl RefUnwindSafe for Type

impl Send for Type

impl Sync for Type

impl Unpin for Type

impl UnwindSafe for Type

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.