Enum llvm_plugin_inkwell::types::BasicTypeEnum
source · [−]pub enum BasicTypeEnum<'ctx> {
ArrayType(ArrayType<'ctx>),
FloatType(FloatType<'ctx>),
IntType(IntType<'ctx>),
PointerType(PointerType<'ctx>),
StructType(StructType<'ctx>),
VectorType(VectorType<'ctx>),
}Expand description
A wrapper for any BasicType.
Variants
ArrayType(ArrayType<'ctx>)
A contiguous homogeneous container type.
FloatType(FloatType<'ctx>)
A floating point type.
IntType(IntType<'ctx>)
An integer type.
PointerType(PointerType<'ctx>)
A pointer type.
StructType(StructType<'ctx>)
A contiguous heterogeneous container type.
VectorType(VectorType<'ctx>)
A contiguous homogeneous “SIMD” container type.
Implementations
sourceimpl<'ctx> BasicTypeEnum<'ctx>
impl<'ctx> BasicTypeEnum<'ctx>
pub fn into_array_type(self) -> ArrayType<'ctx>
pub fn into_float_type(self) -> FloatType<'ctx>
pub fn into_int_type(self) -> IntType<'ctx>
pub fn into_pointer_type(self) -> PointerType<'ctx>
pub fn into_struct_type(self) -> StructType<'ctx>
pub fn into_vector_type(self) -> VectorType<'ctx>
pub fn is_array_type(self) -> bool
pub fn is_float_type(self) -> bool
pub fn is_int_type(self) -> bool
pub fn is_pointer_type(self) -> bool
pub fn is_struct_type(self) -> bool
pub fn is_vector_type(self) -> bool
sourcepub fn const_zero(self) -> BasicValueEnum<'ctx>
pub fn const_zero(self) -> BasicValueEnum<'ctx>
Creates a constant BasicValueZero.
Example
use inkwell::context::Context;
use crate::inkwell::types::BasicType;
let context = Context::create();
let f32_type = context.f32_type().as_basic_type_enum();
let f32_zero = f32_type.const_zero();sourcepub fn print_to_string(self) -> LLVMString
pub fn print_to_string(self) -> LLVMString
Print the definition of a BasicTypeEnum to LLVMString.
Trait Implementations
sourceimpl<'ctx> AnyType<'ctx> for BasicTypeEnum<'ctx>
impl<'ctx> AnyType<'ctx> for BasicTypeEnum<'ctx>
sourcefn as_any_type_enum(&self) -> AnyTypeEnum<'ctx>
fn as_any_type_enum(&self) -> AnyTypeEnum<'ctx>
Returns an AnyTypeEnum that represents the current type.
sourcefn print_to_string(&self) -> LLVMString
fn print_to_string(&self) -> LLVMString
Prints the definition of a Type to a LLVMString.
sourceimpl<'ctx> BasicType<'ctx> for BasicTypeEnum<'ctx>
impl<'ctx> BasicType<'ctx> for BasicTypeEnum<'ctx>
sourcefn as_basic_type_enum(&self) -> BasicTypeEnum<'ctx>
fn as_basic_type_enum(&self) -> BasicTypeEnum<'ctx>
Returns a BasicTypeEnum that represents the current type.
sourcefn fn_type(
&self,
param_types: &[BasicMetadataTypeEnum<'ctx>],
is_var_args: bool
) -> FunctionType<'ctx>
fn fn_type(
&self,
param_types: &[BasicMetadataTypeEnum<'ctx>],
is_var_args: bool
) -> FunctionType<'ctx>
Create a FunctionType with this BasicType as its return type. Read more
sourcefn is_sized(&self) -> bool
fn is_sized(&self) -> bool
Determines whether or not this BasicType is sized or not.
For example, opaque structs are unsized. Read more
sourcefn size_of(&self) -> Option<IntValue<'ctx>>
fn size_of(&self) -> Option<IntValue<'ctx>>
Gets the size of this BasicType. Value may vary depending on the target architecture. Read more
sourcefn array_type(&self, size: u32) -> ArrayType<'ctx>
fn array_type(&self, size: u32) -> ArrayType<'ctx>
Create an ArrayType with this BasicType as its elements. Read more
sourcefn ptr_type(&self, address_space: AddressSpace) -> PointerType<'ctx>
fn ptr_type(&self, address_space: AddressSpace) -> PointerType<'ctx>
Create a PointerType that points to this BasicType. Read more
sourceimpl<'ctx> Clone for BasicTypeEnum<'ctx>
impl<'ctx> Clone for BasicTypeEnum<'ctx>
sourcefn clone(&self) -> BasicTypeEnum<'ctx>
fn clone(&self) -> BasicTypeEnum<'ctx>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<'ctx> Debug for BasicTypeEnum<'ctx>
impl<'ctx> Debug for BasicTypeEnum<'ctx>
sourceimpl Display for BasicTypeEnum<'_>
impl Display for BasicTypeEnum<'_>
sourceimpl<'ctx> From<ArrayType<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> From<ArrayType<'ctx>> for BasicTypeEnum<'ctx>
sourcefn from(value: ArrayType<'_>) -> BasicTypeEnum<'_>
fn from(value: ArrayType<'_>) -> BasicTypeEnum<'_>
Converts to this type from the input type.
sourceimpl<'ctx> From<BasicTypeEnum<'ctx>> for BasicMetadataTypeEnum<'ctx>
impl<'ctx> From<BasicTypeEnum<'ctx>> for BasicMetadataTypeEnum<'ctx>
sourcefn from(value: BasicTypeEnum<'ctx>) -> Self
fn from(value: BasicTypeEnum<'ctx>) -> Self
Converts to this type from the input type.
sourceimpl<'ctx> From<FloatType<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> From<FloatType<'ctx>> for BasicTypeEnum<'ctx>
sourcefn from(value: FloatType<'_>) -> BasicTypeEnum<'_>
fn from(value: FloatType<'_>) -> BasicTypeEnum<'_>
Converts to this type from the input type.
sourceimpl<'ctx> From<IntType<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> From<IntType<'ctx>> for BasicTypeEnum<'ctx>
sourcefn from(value: IntType<'_>) -> BasicTypeEnum<'_>
fn from(value: IntType<'_>) -> BasicTypeEnum<'_>
Converts to this type from the input type.
sourceimpl<'ctx> From<PointerType<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> From<PointerType<'ctx>> for BasicTypeEnum<'ctx>
sourcefn from(value: PointerType<'_>) -> BasicTypeEnum<'_>
fn from(value: PointerType<'_>) -> BasicTypeEnum<'_>
Converts to this type from the input type.
sourceimpl<'ctx> From<StructType<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> From<StructType<'ctx>> for BasicTypeEnum<'ctx>
sourcefn from(value: StructType<'_>) -> BasicTypeEnum<'_>
fn from(value: StructType<'_>) -> BasicTypeEnum<'_>
Converts to this type from the input type.
sourceimpl<'ctx> From<VectorType<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> From<VectorType<'ctx>> for BasicTypeEnum<'ctx>
sourcefn from(value: VectorType<'_>) -> BasicTypeEnum<'_>
fn from(value: VectorType<'_>) -> BasicTypeEnum<'_>
Converts to this type from the input type.
sourceimpl<'ctx> PartialEq<BasicTypeEnum<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> PartialEq<BasicTypeEnum<'ctx>> for BasicTypeEnum<'ctx>
sourcefn eq(&self, other: &BasicTypeEnum<'ctx>) -> bool
fn eq(&self, other: &BasicTypeEnum<'ctx>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for BasicTypeEnum<'ctx>
impl<'ctx> TryFrom<AnyTypeEnum<'ctx>> for BasicTypeEnum<'ctx>
sourceimpl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for ArrayType<'ctx>
impl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for ArrayType<'ctx>
sourceimpl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for FloatType<'ctx>
impl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for FloatType<'ctx>
sourceimpl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for IntType<'ctx>
impl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for IntType<'ctx>
sourceimpl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for PointerType<'ctx>
impl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for PointerType<'ctx>
sourceimpl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for StructType<'ctx>
impl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for StructType<'ctx>
sourceimpl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for VectorType<'ctx>
impl<'ctx> TryFrom<BasicTypeEnum<'ctx>> for VectorType<'ctx>
impl<'ctx> Copy for BasicTypeEnum<'ctx>
impl<'ctx> Eq for BasicTypeEnum<'ctx>
impl<'ctx> StructuralEq for BasicTypeEnum<'ctx>
impl<'ctx> StructuralPartialEq for BasicTypeEnum<'ctx>
Auto Trait Implementations
impl<'ctx> RefUnwindSafe for BasicTypeEnum<'ctx>
impl<'ctx> !Send for BasicTypeEnum<'ctx>
impl<'ctx> !Sync for BasicTypeEnum<'ctx>
impl<'ctx> Unpin for BasicTypeEnum<'ctx>
impl<'ctx> UnwindSafe for BasicTypeEnum<'ctx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more