Struct stable_mir::mir::body::Body
source · pub struct Body {
pub blocks: Vec<BasicBlock>,
pub(super) locals: Vec<LocalDecl>,
pub(super) arg_count: usize,
pub(super) var_debug_info: Vec<VarDebugInfo>,
}Expand description
The SMIR representation of a single function.
Fields§
§blocks: Vec<BasicBlock>§locals: Vec<LocalDecl>§arg_count: usize§var_debug_info: Vec<VarDebugInfo>Implementations§
source§impl Body
impl Body
sourcepub fn new(
blocks: Vec<BasicBlock>,
locals: Vec<LocalDecl>,
arg_count: usize,
var_debug_info: Vec<VarDebugInfo>
) -> Self
pub fn new( blocks: Vec<BasicBlock>, locals: Vec<LocalDecl>, arg_count: usize, var_debug_info: Vec<VarDebugInfo> ) -> 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.
sourcepub fn locals(&self) -> &[LocalDecl]
pub fn locals(&self) -> &[LocalDecl]
Convenience function to get all the locals in this function.
Locals are typically accessed via the more specific methods ret_local,
arg_locals, and inner_locals.
pub fn dump<W: Write>(&self, w: &mut W) -> Result<()>
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
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: 80 bytes