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: ControlRegionThe 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§const fn clone_from(&mut self, source: &Self)
const 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§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