[][src]Struct cranelift_codegen::machinst::sections::MachSections

pub struct MachSections {
    pub sections: Vec<MachSection>,
}

A collection of sections with defined start-offsets.

Fields

sections: Vec<MachSection>

Sections, in offset order.

Methods

impl MachSections[src]

pub fn new() -> MachSections[src]

New, empty set of sections.

pub fn add_section(&mut self, start: CodeOffset, length: CodeOffset) -> usize[src]

Add a section with a known offset and size. Returns the index.

pub fn get_section<'a>(&'a mut self, idx: usize) -> &'a mut MachSection[src]

Mutably borrow the given section by index.

pub fn two_sections<'a>(
    &'a mut self,
    idx1: usize,
    idx2: usize
) -> (&'a mut MachSection, &'a mut MachSection)
[src]

Get mutable borrows of two sections simultaneously. Used during instruction emission to provide references to the .text and .rodata (constant pool) sections.

pub fn emit<CS: CodeSink>(&self, sink: &mut CS)[src]

Emit this set of sections to a set of sinks for the code, relocations, traps, and stackmap.

pub fn get_srclocs_sorted<'a>(&'a self) -> MachSectionsSrcLocs<'a>[src]

Get a list of source location mapping tuples in sorted-by-start-offset order.

pub fn total_size(&self) -> CodeOffset[src]

Get the total required size for these sections.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.