pub struct EmittedFunction { /* private fields */ }Expand description
One emitted function: its place in the code, its frame, and its call-site records.
§Examples
use backend_lang::mir::Function;
use backend_lang::x86_64::{op, Emitter, SYSV};
let mut f = Function::new("f", &SYSV);
let b = f.block()?;
f.push(b, op::RET, &[])?;
let mut e = Emitter::new();
e.function(&f)?;
let p = e.finish()?;
let ef = &p.functions()[0];
assert_eq!((ef.name(), ef.offset(), ef.size()), ("f", 0, 6));Implementations§
Source§impl EmittedFunction
impl EmittedFunction
Sourcepub fn frame(&self) -> &FrameLayout
pub fn frame(&self) -> &FrameLayout
Its frame. With the stack pointer fixed in the body, the canonical
frame address is the body’s stack pointer plus
cfa_offset, which is all a stack walker
needs to step from a call site to its caller.
§Examples
See EmittedFunction.
Sourcepub fn call_sites(&self) -> &[CallSiteRecord]
pub fn call_sites(&self) -> &[CallSiteRecord]
Trait Implementations§
Source§impl Clone for EmittedFunction
impl Clone for EmittedFunction
Source§impl Debug for EmittedFunction
impl Debug for EmittedFunction
impl Eq for EmittedFunction
Source§impl PartialEq for EmittedFunction
impl PartialEq for EmittedFunction
impl StructuralPartialEq for EmittedFunction
Auto Trait Implementations§
impl Freeze for EmittedFunction
impl RefUnwindSafe for EmittedFunction
impl Send for EmittedFunction
impl Sync for EmittedFunction
impl Unpin for EmittedFunction
impl UnsafeUnpin for EmittedFunction
impl UnwindSafe for EmittedFunction
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