pub struct BlockCall { /* private fields */ }Expand description
A branch target and the arguments passed to its block parameters. Made by
Function::block_call, which stores
the arguments in the function; read them back with
Function::args.
§Examples
use backend_lang::mir::{Function, Operand};
use backend_lang::x86_64::{SYSV, RAX};
let mut f = Function::new("f", &SYSV);
let _entry = f.block()?;
let next = f.block()?;
let call = f.block_call(next, &[Operand::Reg(RAX.into())])?;
assert_eq!(call.block(), next);
assert_eq!(f.args(call), [Operand::Reg(RAX.into())]);Implementations§
Source§impl BlockCall
impl BlockCall
Sourcepub const fn block(&self) -> Block
pub const fn block(&self) -> Block
The target block.
§Examples
use backend_lang::mir::Function;
use backend_lang::x86_64::SYSV;
let mut f = Function::new("f", &SYSV);
let b = f.block()?;
assert_eq!(f.block_call(b, &[])?.block(), b);Trait Implementations§
impl Copy for BlockCall
impl Eq for BlockCall
impl StructuralPartialEq for BlockCall
Auto Trait Implementations§
impl Freeze for BlockCall
impl RefUnwindSafe for BlockCall
impl Send for BlockCall
impl Sync for BlockCall
impl Unpin for BlockCall
impl UnsafeUnpin for BlockCall
impl UnwindSafe for BlockCall
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