Struct stable_mir::mir::body::Body
source · pub struct Body {
pub blocks: Vec<BasicBlock>,
pub(super) locals: Vec<LocalDecl>,
pub(super) arg_count: usize,
}Expand description
The SMIR representation of a single function.
Fields§
§blocks: Vec<BasicBlock>§locals: Vec<LocalDecl>§arg_count: usizeImplementations§
source§impl Body
impl Body
sourcepub fn new(
blocks: Vec<BasicBlock>,
locals: Vec<LocalDecl>,
arg_count: usize
) -> Self
pub fn new( blocks: Vec<BasicBlock>, locals: Vec<LocalDecl>, arg_count: usize ) -> Self
Constructs a Body.
A constructor is required to build a Body from outside the crate
because the arg_count and locals fields are private.
sourcepub fn arg_locals(&self) -> &[LocalDecl]
pub fn arg_locals(&self) -> &[LocalDecl]
Locals in self that correspond to this function’s arguments.
sourcepub fn inner_locals(&self) -> &[LocalDecl]
pub fn inner_locals(&self) -> &[LocalDecl]
Inner locals for this function. These are the locals that are neither the return local nor the argument locals.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnwindSafe for Body
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes