Struct inkwell::targets::TargetData
source · pub struct TargetData { /* private fields */ }
Implementations§
source§impl TargetData
impl TargetData
pub unsafe fn new(target_data: LLVMTargetDataRef) -> TargetData
sourcepub fn as_mut_ptr(&self) -> LLVMTargetDataRef
pub fn as_mut_ptr(&self) -> LLVMTargetDataRef
Acquires the underlying raw pointer belonging to this TargetData
type.
sourcepub 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.
pub fn ptr_sized_int_type_in_context<'ctx>( &self, context: impl AsContextRef<'ctx>, address_space: Option<AddressSpace> ) -> IntType<'ctx>
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);
pub fn get_data_layout(&self) -> DataLayout
pub fn get_bit_size(&self, type_: &dyn AnyType<'_>) -> u64
pub fn create(str_repr: &str) -> TargetData
pub fn get_byte_ordering(&self) -> ByteOrdering
pub fn get_pointer_byte_size(&self, address_space: Option<AddressSpace>) -> u32
pub fn get_store_size(&self, type_: &dyn AnyType<'_>) -> u64
pub fn get_abi_size(&self, type_: &dyn AnyType<'_>) -> u64
pub fn get_abi_alignment(&self, type_: &dyn AnyType<'_>) -> u32
pub fn get_call_frame_alignment(&self, type_: &dyn AnyType<'_>) -> u32
pub fn get_preferred_alignment(&self, type_: &dyn AnyType<'_>) -> u32
pub fn get_preferred_alignment_of_global(&self, value: &GlobalValue<'_>) -> u32
pub fn element_at_offset( &self, struct_type: &StructType<'_>, offset: u64 ) -> u32
pub fn offset_of_element( &self, struct_type: &StructType<'_>, element: u32 ) -> Option<u64>
Trait Implementations§
source§impl Debug for TargetData
impl Debug for TargetData
source§impl Drop for TargetData
impl Drop for TargetData
source§impl PartialEq for TargetData
impl PartialEq for TargetData
source§fn eq(&self, other: &TargetData) -> bool
fn eq(&self, other: &TargetData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for TargetData
impl StructuralPartialEq for TargetData
Auto Trait Implementations§
impl RefUnwindSafe for TargetData
impl !Send for TargetData
impl !Sync for TargetData
impl Unpin for TargetData
impl UnwindSafe for TargetData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more