Struct cairo_lang_lowering::objects::StructuredBlock
source · pub struct StructuredBlock {
pub inputs: Vec<VariableId>,
pub statements: Vec<Statement>,
pub drops: Vec<VariableId>,
pub end: StructuredBlockEnd,
}
Expand description
A block of statements. Each block gets inputs and outputs, and is composed of a linear sequence of statements.
A block may end with a return
, which exits the current function.
A block contains the list of variables to be dropped at its end. Other than these variables and the output variables, it is guaranteed that no other variable is alive.
Fields§
§inputs: Vec<VariableId>
Input variables to the block, including implicits.
statements: Vec<Statement>
Statements sequence running one after the other in the block, in a linear flow.
Note: Inner blocks might end with a return
, which will exit the function in the middle.
Note: Match is a possible statement, which means it has control flow logic inside, but
after its execution is completed, the flow returns to the following statement of the block.
drops: Vec<VariableId>
Which variables are needed to be dropped at the end of this block. Note that these are not explicitly dropped by statements.
end: StructuredBlockEnd
Describes how this block ends: returns to the caller or exits the function.
Trait Implementations§
source§impl Clone for StructuredBlock
impl Clone for StructuredBlock
source§fn clone(&self) -> StructuredBlock
fn clone(&self) -> StructuredBlock
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StructuredBlock
impl Debug for StructuredBlock
source§impl DebugWithDb<LoweredFormatter<'_>> for StructuredBlock
impl DebugWithDb<LoweredFormatter<'_>> for StructuredBlock
source§impl PartialEq<StructuredBlock> for StructuredBlock
impl PartialEq<StructuredBlock> for StructuredBlock
source§fn eq(&self, other: &StructuredBlock) -> bool
fn eq(&self, other: &StructuredBlock) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<StructuredBlock> for FlatBlock
impl TryFrom<StructuredBlock> for FlatBlock
impl Eq for StructuredBlock
impl StructuralEq for StructuredBlock
impl StructuralPartialEq for StructuredBlock
Auto Trait Implementations§
impl RefUnwindSafe for StructuredBlock
impl Send for StructuredBlock
impl Sync for StructuredBlock
impl Unpin for StructuredBlock
impl UnwindSafe for StructuredBlock
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.