[−][src]Trait cranelift_codegen::machinst::sections::MachSectionOutput
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
)
&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.
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.
Implementors
impl MachSectionOutput for MachSection
[src]
fn cur_offset_from_start(&self) -> CodeOffset
[src]
fn start_offset(&self) -> CodeOffset
[src]
fn put1(&mut self, value: u8)
[src]
fn put_data(&mut self, data: &[u8])
[src]
fn add_reloc(
&mut self,
srcloc: SourceLoc,
kind: Reloc,
name: &ExternalName,
addend: Addend
)
[src]
&mut self,
srcloc: SourceLoc,
kind: Reloc,
name: &ExternalName,
addend: Addend
)