Struct inkwell::targets::TargetData

source ·
pub struct TargetData { /* private fields */ }

Implementations§

source§

impl TargetData

source

pub unsafe fn new(target_data: LLVMTargetDataRef) -> TargetData

source

pub fn as_mut_ptr(&self) -> LLVMTargetDataRef

Acquires the underlying raw pointer belonging to this TargetData type.

source

pub fn ptr_sized_int_type_in_context<'ctx>( &self, context: impl AsContextRef<'ctx>, address_space: Option<AddressSpace> ) -> IntType<'ctx>

👎Deprecated: This method will be removed in the future. Please use Context::ptr_sized_int_type instead.

Gets the IntType representing a bit width of a pointer. It will be assigned the referenced context.

§Example
use inkwell::OptimizationLevel;
use inkwell::context::Context;
use inkwell::targets::{InitializationConfig, Target};

Target::initialize_native(&InitializationConfig::default()).expect("Failed to initialize native target");

let context = Context::create();
let module = context.create_module("sum");
let execution_engine = module.create_jit_execution_engine(OptimizationLevel::None).unwrap();
let target_data = execution_engine.get_target_data();
let int_type = target_data.ptr_sized_int_type_in_context(&context, None);
source

pub fn get_data_layout(&self) -> DataLayout

source

pub fn get_bit_size(&self, type_: &dyn AnyType<'_>) -> u64

source

pub fn create(str_repr: &str) -> TargetData

source

pub fn get_byte_ordering(&self) -> ByteOrdering

source

pub fn get_pointer_byte_size(&self, address_space: Option<AddressSpace>) -> u32

source

pub fn get_store_size(&self, type_: &dyn AnyType<'_>) -> u64

source

pub fn get_abi_size(&self, type_: &dyn AnyType<'_>) -> u64

source

pub fn get_abi_alignment(&self, type_: &dyn AnyType<'_>) -> u32

source

pub fn get_call_frame_alignment(&self, type_: &dyn AnyType<'_>) -> u32

source

pub fn get_preferred_alignment(&self, type_: &dyn AnyType<'_>) -> u32

source

pub fn get_preferred_alignment_of_global(&self, value: &GlobalValue<'_>) -> u32

source

pub fn element_at_offset( &self, struct_type: &StructType<'_>, offset: u64 ) -> u32

source

pub fn offset_of_element( &self, struct_type: &StructType<'_>, element: u32 ) -> Option<u64>

Trait Implementations§

source§

impl Debug for TargetData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for TargetData

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl PartialEq for TargetData

source§

fn eq(&self, other: &TargetData) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for TargetData

source§

impl StructuralPartialEq for TargetData

Auto Trait Implementations§

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

§

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>,

§

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.