[−][src]Trait rustc_codegen_llvm::type_of::LayoutLlvmExt

pub trait LayoutLlvmExt<'tcx> {
    pub fn is_llvm_immediate(&self) -> bool;
pub fn is_llvm_scalar_pair(&self) -> bool;
pub fn llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type;
pub fn immediate_llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type;
pub fn scalar_llvm_type_at<'a>(
        &self,
        cx: &CodegenCx<'a, 'tcx>,
        scalar: &Scalar,
        offset: Size
    ) -> &'a Type;
pub fn scalar_pair_element_llvm_type<'a>(
        &self,
        cx: &CodegenCx<'a, 'tcx>,
        index: usize,
        immediate: bool
    ) -> &'a Type;
pub fn llvm_field_index(&self, index: usize) -> u64;
pub fn pointee_info_at<'a>(
        &self,
        cx: &CodegenCx<'a, 'tcx>,
        offset: Size
    ) -> Option<PointeeInfo>; }

Required methods

pub fn is_llvm_immediate(&self) -> bool[src]

pub fn is_llvm_scalar_pair(&self) -> bool[src]

pub fn llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type[src]

pub fn immediate_llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type[src]

pub fn scalar_llvm_type_at<'a>(
    &self,
    cx: &CodegenCx<'a, 'tcx>,
    scalar: &Scalar,
    offset: Size
) -> &'a Type
[src]

pub fn scalar_pair_element_llvm_type<'a>(
    &self,
    cx: &CodegenCx<'a, 'tcx>,
    index: usize,
    immediate: bool
) -> &'a Type
[src]

pub fn llvm_field_index(&self, index: usize) -> u64[src]

pub fn pointee_info_at<'a>(
    &self,
    cx: &CodegenCx<'a, 'tcx>,
    offset: Size
) -> Option<PointeeInfo>
[src]

Loading content...

Implementations on Foreign Types

impl<'tcx> LayoutLlvmExt<'tcx> for TyAndLayout<'tcx>[src]

pub fn llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type[src]

Gets the LLVM type corresponding to a Rust type, i.e., rustc_middle::ty::Ty. The pointee type of the pointer in PlaceRef is always this type. For sized types, it is also the right LLVM type for an alloca containing a value of that type, and most immediates (except bool). Unsized types, however, are represented by a "minimal unit", e.g. [T] becomes T, while str and Trait turn into i8 - this is useful for indexing slices, as &[T]'s data pointer is T*. If the type is an unsized struct, the regular layout is generated, with the inner-most trailing unsized field using the "minimal unit" of that field's type - this is useful for taking the address of that field and ensuring the struct has the right alignment.

Loading content...

Implementors

Loading content...