pub struct FuncDefBody {
pub control_regions: EntityDefs<ControlRegion>,
pub control_nodes: EntityDefs<ControlNode>,
pub data_insts: EntityDefs<DataInst>,
pub body: ControlRegion,
pub unstructured_cfg: Option<ControlFlowGraph>,
}
Expand description
The body of a Func
definition.
Fields§
§control_regions: EntityDefs<ControlRegion>
§control_nodes: EntityDefs<ControlNode>
§data_insts: EntityDefs<DataInst>
§body: ControlRegion
The ControlRegion
representing the whole body of the function.
Function parameters are provided via body.inputs
, i.e. they can be
only accessed with Value::ControlRegionInputs { region: body, idx }
.
When unstructured_cfg
is None
, this includes the structured return
of the function, with body.outputs
as the returned values.
unstructured_cfg: Option<ControlFlowGraph>
The unstructured (part of the) control-flow graph of the function.
Only present if structurization wasn’t attempted, or if was only partial (leaving behind a mix of structured and unstructured control-flow).
When present, it starts at body
(more specifically, its exit),
effectively replacing the structured return body
otherwise implies,
with body
(or rather, its children
) always being fully structured.
Implementations§
source§impl FuncDefBody
impl FuncDefBody
sourcepub fn at<P: Copy>(&self, position: P) -> FuncAt<'_, P>
pub fn at<P: Copy>(&self, position: P) -> FuncAt<'_, P>
Start immutably traversing the function at position
.
sourcepub fn at_mut<P: Copy>(&mut self, position: P) -> FuncAtMut<'_, P>
pub fn at_mut<P: Copy>(&mut self, position: P) -> FuncAtMut<'_, P>
Start mutably traversing the function at position
.
sourcepub fn at_body(&self) -> FuncAt<'_, ControlRegion>
pub fn at_body(&self) -> FuncAt<'_, ControlRegion>
Shorthand for func_def_body.at(func_def_body.body)
.
sourcepub fn at_mut_body(&mut self) -> FuncAtMut<'_, ControlRegion>
pub fn at_mut_body(&mut self) -> FuncAtMut<'_, ControlRegion>
Shorthand for func_def_body.at_mut(func_def_body.body)
.
Trait Implementations§
source§impl Clone for FuncDefBody
impl Clone for FuncDefBody
source§fn clone(&self) -> FuncDefBody
fn clone(&self) -> FuncDefBody
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl InnerInPlaceTransform for FuncDefBody
impl InnerInPlaceTransform for FuncDefBody
fn inner_in_place_transform_with(&mut self, transformer: &mut impl Transformer)
source§impl InnerVisit for FuncDefBody
impl InnerVisit for FuncDefBody
fn inner_visit_with<'a>(&'a self, visitor: &mut impl Visitor<'a>)
Auto Trait Implementations§
impl Freeze for FuncDefBody
impl RefUnwindSafe for FuncDefBody
impl Send for FuncDefBody
impl Sync for FuncDefBody
impl Unpin for FuncDefBody
impl UnwindSafe for FuncDefBody
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<'a, T, V> DynInnerVisit<'a, V> for Twhere
T: InnerVisit,
V: Visitor<'a>,
impl<'a, T, V> DynInnerVisit<'a, V> for Twhere
T: InnerVisit,
V: Visitor<'a>,
fn dyn_inner_visit_with(&'a self, visitor: &mut V)
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more