pub struct MirFunction {
pub name: String,
pub arity: usize,
pub return_ty: Ty,
pub locals: PrimaryMap<MirLocalId, LocalInfo>,
pub params: Vec<MirLocalId>,
pub param_modes: Vec<MirOwnershipMode>,
pub entry: MirBlockId,
pub blocks: PrimaryMap<MirBlockId, MirBlock>,
}Expand description
Function-level MIR in CFG form.
paramsare function parameter locals.param_modesmirrors source ownership modes for parameters.entryis the first block reached for execution.
Fields§
§name: StringUser-visible function or field name.
arity: usizeNumber of source parameters accepted by the function.
return_ty: TySemantic return type of the function.
locals: PrimaryMap<MirLocalId, LocalInfo>Local metadata arena for function values.
params: Vec<MirLocalId>Local ids corresponding to incoming parameters.
param_modes: Vec<MirOwnershipMode>Ownership modes for each incoming parameter.
entry: MirBlockIdEntry block id for the function CFG.
blocks: PrimaryMap<MirBlockId, MirBlock>CFG blocks stored for the function.
Implementations§
Source§impl MirFunction
impl MirFunction
Sourcepub fn param_binding(&self, index: usize) -> MirParamBinding<'_>
pub fn param_binding(&self, index: usize) -> MirParamBinding<'_>
Return metadata for one parameter by index.
Sourcepub fn param_bindings(&self) -> impl Iterator<Item = MirParamBinding<'_>>
pub fn param_bindings(&self) -> impl Iterator<Item = MirParamBinding<'_>>
Iterate over source parameters with normalized query helpers.
Sourcepub fn local_info(&self, local_id: MirLocalId) -> &LocalInfo
pub fn local_info(&self, local_id: MirLocalId) -> &LocalInfo
Return metadata for one local.
Sourcepub fn call_arg_binding<'a>(
&'a self,
arg: &'a MirCallArg,
) -> MirCallArgBinding<'a>
pub fn call_arg_binding<'a>( &'a self, arg: &'a MirCallArg, ) -> MirCallArgBinding<'a>
Return normalized metadata for one call argument.
Sourcepub fn assert_valid(&self)
pub fn assert_valid(&self)
Assert internal MIR invariants needed by downstream backends.
Trait Implementations§
Source§impl Clone for MirFunction
impl Clone for MirFunction
Source§fn clone(&self) -> MirFunction
fn clone(&self) -> MirFunction
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MirFunction
impl RefUnwindSafe for MirFunction
impl Send for MirFunction
impl Sync for MirFunction
impl Unpin for MirFunction
impl UnwindSafe for MirFunction
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