pub struct LLVMTargetData(/* private fields */);Expand description
RAII wrapper around LLVMTargetDataReff
Implementations§
Source§impl LLVMTargetData
impl LLVMTargetData
Sourcepub fn new(layout: &str) -> Self
pub fn new(layout: &str) -> Self
LLVMCreateTargetData
Note: layout is not validated (the C-API gives no way to do that).
Sourcepub fn host() -> Result<Self, String>
pub fn host() -> Result<Self, String>
Build the layout of the machine that this program runs on.
Sourcepub fn copy_string_rep_of_target_data(&self) -> String
pub fn copy_string_rep_of_target_data(&self) -> String
LLVMCopyStringRepOfTargetData
Sourcepub fn size_of_type_in_bits(&self, ty: LLVMType) -> u64
pub fn size_of_type_in_bits(&self, ty: LLVMType) -> u64
LLVMSizeOfTypeInBits
Sourcepub fn store_size_of_type(&self, ty: LLVMType) -> u64
pub fn store_size_of_type(&self, ty: LLVMType) -> u64
LLVMStoreSizeOfType
Sourcepub fn abi_size_of_type(&self, ty: LLVMType) -> u64
pub fn abi_size_of_type(&self, ty: LLVMType) -> u64
LLVMABISizeOfType: Misnomer. It actually is `llvm::DataLayout::getTypeAllocSize.
Sourcepub fn abi_alignment_of_type(&self, ty: LLVMType) -> u32
pub fn abi_alignment_of_type(&self, ty: LLVMType) -> u32
LLVMABIAlignmentOfType
Sourcepub fn preferred_alignment_of_type(&self, ty: LLVMType) -> u32
pub fn preferred_alignment_of_type(&self, ty: LLVMType) -> u32
LLVMPreferredAlignmentOfType
Sourcepub fn offset_of_element(&self, struct_ty: LLVMType, index: u32) -> u64
pub fn offset_of_element(&self, struct_ty: LLVMType, index: u32) -> u64
LLVMOffsetOfElement
Sourcepub fn pointer_size_for_as(&self, addr_space: u32) -> u32
pub fn pointer_size_for_as(&self, addr_space: u32) -> u32
LLVMPointerSizeForAS
Trait Implementations§
Source§impl Drop for LLVMTargetData
impl Drop for LLVMTargetData
Auto Trait Implementations§
impl !Send for LLVMTargetData
impl !Sync for LLVMTargetData
impl Freeze for LLVMTargetData
impl RefUnwindSafe for LLVMTargetData
impl Unpin for LLVMTargetData
impl UnsafeUnpin for LLVMTargetData
impl UnwindSafe for LLVMTargetData
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.