Struct llvm_plugin_inkwell::targets::TargetData
source · pub struct TargetData { /* private fields */ }Implementations§
source§impl TargetData
impl TargetData
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<TargetData> for TargetData
impl PartialEq<TargetData> 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 ==.