[][src]Trait cranelift_codegen::machinst::sections::MachSectionOutput

pub trait MachSectionOutput {
    fn cur_offset_from_start(&self) -> CodeOffset;
fn start_offset(&self) -> CodeOffset;
fn put1(&mut self, _: u8);
fn put_data(&mut self, data: &[u8]);
fn add_reloc(
        &mut self,
        loc: SourceLoc,
        kind: Reloc,
        name: &ExternalName,
        addend: Addend
    );
fn add_trap(&mut self, loc: SourceLoc, code: TrapCode);
fn add_call_site(&mut self, loc: SourceLoc, opcode: Opcode);
fn start_srcloc(&mut self, loc: SourceLoc);
fn end_srcloc(&mut self); fn put2(&mut self, value: u16) { ... }
fn put4(&mut self, value: u32) { ... }
fn put8(&mut self, value: u64) { ... }
fn align_to(&mut self, align_to: CodeOffset) { ... } }

An abstraction over MachSection and MachSectionSize: some receiver of section data.

Required methods

fn cur_offset_from_start(&self) -> CodeOffset

Get the current offset from the start of all sections.

fn start_offset(&self) -> CodeOffset

Get the start offset of this section.

fn put1(&mut self, _: u8)

Add 1 byte to the section.

fn put_data(&mut self, data: &[u8])

Add a slice of bytes to the section.

fn add_reloc(
    &mut self,
    loc: SourceLoc,
    kind: Reloc,
    name: &ExternalName,
    addend: Addend
)

Add a relocation at the current offset.

fn add_trap(&mut self, loc: SourceLoc, code: TrapCode)

Add a trap record at the current offset.

fn add_call_site(&mut self, loc: SourceLoc, opcode: Opcode)

Add a call return address record at the current offset.

fn start_srcloc(&mut self, loc: SourceLoc)

Start the output for the given source-location at the current offset.

fn end_srcloc(&mut self)

End the output for the previously-given source-location at the current offset.

Loading content...

Provided methods

fn put2(&mut self, value: u16)

Add 2 bytes to the section.

fn put4(&mut self, value: u32)

Add 4 bytes to the section.

fn put8(&mut self, value: u64)

Add 8 bytes to the section.

fn align_to(&mut self, align_to: CodeOffset)

Align up to the given alignment.

Loading content...

Implementors

impl MachSectionOutput for MachSection[src]

impl MachSectionOutput for MachSectionSize[src]

Loading content...