Struct llvm_rs::TargetData
source · pub struct TargetData(_);Expand description
Represents an LLVM Target
Implementations§
source§impl TargetData
impl TargetData
sourcepub fn from_string(rep: &str) -> TargetData
pub fn from_string(rep: &str) -> TargetData
Create a target data from a target layout string.
sourcepub fn is_big_endian(&self) -> bool
pub fn is_big_endian(&self) -> bool
Returns true if the target is big endian.
sourcepub fn get_pointer_size(&self) -> usize
pub fn get_pointer_size(&self) -> usize
Returns the size of a pointer on the target.
sourcepub fn size_of_in_bits(&self, ty: &Type) -> u64
pub fn size_of_in_bits(&self, ty: &Type) -> u64
Returns the size of the type given in bits.
sourcepub fn alignment_of(&self, ty: &Type) -> usize
pub fn alignment_of(&self, ty: &Type) -> usize
Returns the alignment of the type given in bytes.
sourcepub fn element_at(&self, struct_ty: &Type, offset: u64) -> usize
pub fn element_at(&self, struct_ty: &Type, offset: u64) -> usize
Computes the structure element that contains the byte offset for a target.
Trait Implementations§
source§impl Display for TargetData
impl Display for TargetData
source§impl Drop for TargetData
impl Drop for TargetData
source§impl<'a> From<&'a TargetData> for LLVMTargetDataRef
impl<'a> From<&'a TargetData> for LLVMTargetDataRef
source§fn from(ty: &'a TargetData) -> LLVMTargetDataRef
fn from(ty: &'a TargetData) -> LLVMTargetDataRef
Converts to this type from the input type.
source§impl<'a> From<&'a mut TargetData> for LLVMTargetDataRef
impl<'a> From<&'a mut TargetData> for LLVMTargetDataRef
source§fn from(ty: &'a mut TargetData) -> LLVMTargetDataRef
fn from(ty: &'a mut TargetData) -> LLVMTargetDataRef
Converts to this type from the input type.
source§impl<'a> From<*mut LLVMOpaqueTargetData> for &'a TargetData
impl<'a> From<*mut LLVMOpaqueTargetData> for &'a TargetData
source§fn from(ty: LLVMTargetDataRef) -> &'a TargetData
fn from(ty: LLVMTargetDataRef) -> &'a TargetData
Converts to this type from the input type.
source§impl<'a> From<*mut LLVMOpaqueTargetData> for &'a mut TargetData
impl<'a> From<*mut LLVMOpaqueTargetData> for &'a mut TargetData
source§fn from(ty: LLVMTargetDataRef) -> &'a mut TargetData
fn from(ty: LLVMTargetDataRef) -> &'a mut TargetData
Converts to this type from the input type.