Type Alias SimpleCx

Source
pub(crate) type SimpleCx<'ll> = GenericCx<'ll, SCx<'ll>>;

Aliased Type§

struct SimpleCx<'ll>(SCx<'ll>, PhantomData<SCx<'ll>>);

Fields§

§0: SCx<'ll>§1: PhantomData<SCx<'ll>>

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes

Implementations

Source§

impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX>

Source

pub(crate) fn set_metadata<'a>( &self, val: &'a Value, kind_id: impl Into<MetadataKindId>, md: &'ll Metadata, )

A wrapper for llvm::LLVMSetMetadata, but it takes Metadata as a parameter instead of Value.

Source§

impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX>

Source

pub(crate) fn get_metadata_value(&self, metadata: &'ll Metadata) -> &'ll Value

Source

pub(crate) fn get_const_i64(&self, n: u64) -> &'ll Value

Source

pub(crate) fn get_function(&self, name: &str) -> Option<&'ll Value>

Source

pub(crate) fn get_md_kind_id(&self, name: &str) -> MetadataKindId

Source

pub(crate) fn create_metadata(&self, name: String) -> Option<&'ll Metadata>

Source§

impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX>

Source

pub(crate) fn declare_global(&self, name: &str, ty: &'ll Type) -> &'ll Value

Declare a global value.

If there’s a value with the same name already declared, the function will return its Value instead.

Source§

impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX>

Source

pub(crate) fn llcx(&self) -> &'ll Context

Source

pub(crate) fn isize_ty(&self) -> &'ll Type

Source

pub(crate) fn type_variadic_func( &self, args: &[&'ll Type], ret: &'ll Type, ) -> &'ll Type

Source

pub(crate) fn type_i1(&self) -> &'ll Type

Source

pub(crate) fn type_struct(&self, els: &[&'ll Type], packed: bool) -> &'ll Type

Source§

impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX>

Source

pub(crate) fn type_named_struct(&self, name: &str) -> &'ll Type

Source

pub(crate) fn set_struct_body( &self, ty: &'ll Type, els: &[&'ll Type], packed: bool, )

Source

pub(crate) fn type_void(&self) -> &'ll Type

Source

pub(crate) fn type_token(&self) -> &'ll Type

Source

pub(crate) fn type_metadata(&self) -> &'ll Type

Source

pub(crate) fn type_ix(&self, num_bits: u64) -> &'ll Type

x Creates an integer type with the given number of bits, e.g., i24

Source

pub(crate) fn type_vector(&self, ty: &'ll Type, len: u64) -> &'ll Type

Source

pub(crate) fn func_params_types(&self, ty: &'ll Type) -> Vec<&'ll Type>

Source§

impl<'ll> GenericCx<'ll, SCx<'ll>>

Source

pub(crate) fn get_return_type(&self, ty: &'ll Type) -> &'ll Type

Source

pub(crate) fn get_type_of_global(&self, val: &'ll Value) -> &'ll Type

Source

pub(crate) fn val_ty(&self, v: &'ll Value) -> &'ll Type

Source§

impl<'ll> GenericCx<'ll, SCx<'ll>>

Source

pub(crate) fn new( llmod: &'ll Module, llcx: &'ll Context, pointer_size: Size, ) -> Self

Trait Implementations

Source§

impl<'ll, CX: Borrow<SCx<'ll>>> BackendTypes for GenericCx<'ll, CX>

Source§

impl<'ll, CX: Borrow<SCx<'ll>>> BaseTypeCodegenMethods for GenericCx<'ll, CX>

Source§

fn type_i8(&self) -> &'ll Type

Source§

fn type_i16(&self) -> &'ll Type

Source§

fn type_i32(&self) -> &'ll Type

Source§

fn type_i64(&self) -> &'ll Type

Source§

fn type_i128(&self) -> &'ll Type

Source§

fn type_isize(&self) -> &'ll Type

Source§

fn type_f16(&self) -> &'ll Type

Source§

fn type_f32(&self) -> &'ll Type

Source§

fn type_f64(&self) -> &'ll Type

Source§

fn type_f128(&self) -> &'ll Type

Source§

fn type_func(&self, args: &[&'ll Type], ret: &'ll Type) -> &'ll Type

Source§

fn type_kind(&self, ty: &'ll Type) -> TypeKind

Source§

fn type_ptr(&self) -> &'ll Type

Source§

fn type_ptr_ext(&self, address_space: AddressSpace) -> &'ll Type

Source§

fn element_type(&self, ty: &'ll Type) -> &'ll Type

Source§

fn vector_length(&self, ty: &'ll Type) -> usize

Returns the number of elements in self if it is an LLVM vector type.
Source§

fn float_width(&self, ty: &'ll Type) -> usize

Source§

fn int_width(&self, ty: &'ll Type) -> u64

Retrieves the bit width of the integer type self.
Source§

fn val_ty(&self, v: &'ll Value) -> &'ll Type

Source§

fn type_array(&self, ty: &'ll Type, len: u64) -> &'ll Type

Source§

impl<'ll, T: Borrow<SCx<'ll>>> Deref for GenericCx<'ll, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.