Struct TargetData

Source
pub struct TargetData<'a>(/* private fields */);
Expand description

LLVMTargetData wrapper

Implementations§

Source§

impl<'a> TargetData<'a>

Source

pub fn new(s: impl AsRef<str>) -> Result<TargetData<'a>, Error>

Create new target data with the given triple

Source

pub fn string_rep(&self) -> Message

Return a string representation

Source

pub fn byte_order(&self) -> ByteOrder

Get configured byte order

Source

pub fn pointer_size(&self) -> usize

Get configured pointer size

Source

pub fn pointer_size_for_address_space(&self, addr_space: usize) -> usize

Get pointer size for the given address space

Source

pub fn int_ptr_type(&self, ctx: &Context<'a>) -> Result<Type<'a>, Error>

Get the type used for integer pointers

Source

pub fn int_ptr_type_for_address_space( &self, ctx: &Context<'a>, addr_space: usize, ) -> Result<Type<'a>, Error>

Get the type used for integer pointers in the given address space

Source

pub fn size_of_type_in_bits(&self, t: impl AsRef<Type<'a>>) -> usize

Get the size of a type in bits

Source

pub fn store_size_of_type(&self, t: impl AsRef<Type<'a>>) -> usize

Get the storage size of a type

Source

pub fn abi_size_of_type(&self, t: impl AsRef<Type<'a>>) -> usize

Get the ABI size of a type

Source

pub fn abi_alignment_of_type(&self, t: impl AsRef<Type<'a>>) -> usize

Get the ABI alignment of a type

Source

pub fn call_frame_alignment_of_type(&self, t: impl AsRef<Type<'a>>) -> usize

Get the call frame alignment of a type

Source

pub fn preferred_alignment_of_type(&self, t: impl AsRef<Type<'a>>) -> usize

Get type’s preferred alignment

Source

pub fn preferred_alignment_of_global(&self, t: impl AsRef<Value<'a>>) -> usize

Get preferred alignment for a global value

Source

pub fn struct_element_at_offset( &self, t: impl AsRef<Type<'a>>, offset: usize, ) -> usize

Get the index of the struct element at the given offset

Source

pub fn struct_offset_of_element( &self, t: impl AsRef<Type<'a>>, index: usize, ) -> usize

Get the offset of the element at the given index

Trait Implementations§

Source§

impl<'a> Drop for TargetData<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a> LLVM<LLVMOpaqueTargetData> for TargetData<'a>

Source§

fn llvm(&self) -> *mut LLVMOpaqueTargetData

Return a LLVM pointer

Auto Trait Implementations§

§

impl<'a> Freeze for TargetData<'a>

§

impl<'a> RefUnwindSafe for TargetData<'a>

§

impl<'a> !Send for TargetData<'a>

§

impl<'a> !Sync for TargetData<'a>

§

impl<'a> Unpin for TargetData<'a>

§

impl<'a> UnwindSafe for TargetData<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.