pub struct PhiNode { /* private fields */ }
Expand description
Represents a Phi node in SSA form.
Phi nodes are used to merge values coming from different control-flow paths.
Initially, the phi node has no arguments (i.e. no predecessor regions), but you
can add them later using the [add_region
] method.
Implementations§
Source§impl PhiNode
impl PhiNode
Sourcepub fn add_region(&mut self, region: RegionId, edge_type: ControlFlowEdgeType)
pub fn add_region(&mut self, region: RegionId, edge_type: ControlFlowEdgeType)
Adds a predecessor RegionId
to this phi node.
This method allows the phi node to record a region (i.e. a basic block ID) from which a value is coming.
§Arguments
region
- The identifier of the predecessor region.
Sourcepub fn add_regions(&mut self, regions: Vec<(RegionId, ControlFlowEdgeType)>)
pub fn add_regions(&mut self, regions: Vec<(RegionId, ControlFlowEdgeType)>)
Adds predecessor RegionId
s to this phi node.
This method allows the phi node to record multiple regions (i.e. basic block IDs) from which values are coming.
§Arguments
regions
- The identifiers of the predecessor regions.
Sourcepub fn regions(&self) -> &[(RegionId, ControlFlowEdgeType)]
pub fn regions(&self) -> &[(RegionId, ControlFlowEdgeType)]
Returns a reference to the list of region IDs associated with this phi node.
§Returns
A slice containing all the predecessor region IDs added so far.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PhiNode
impl<'de> Deserialize<'de> for PhiNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PhiNode
impl StructuralPartialEq for PhiNode
Auto Trait Implementations§
impl Freeze for PhiNode
impl RefUnwindSafe for PhiNode
impl Send for PhiNode
impl Sync for PhiNode
impl Unpin for PhiNode
impl UnwindSafe for PhiNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.