#[non_exhaustive]pub enum PirOperation {
Show 13 variants
LexicalRead {
name: LexicalName,
},
LexicalWrite {
name: LexicalName,
},
StashRead {
symbol: SymbolName,
},
StashWrite {
symbol: SymbolName,
},
Modify {
name: LexicalName,
op: String,
},
StashModify {
symbol: SymbolName,
op: String,
},
Assign,
Call {
callee: PirCallee,
arg_count: usize,
},
MethodCall {
receiver: PirReceiver,
method: PirMethod,
arg_count: usize,
},
Branch {
condition: Option<PirId>,
},
Loop {
condition: Option<PirId>,
},
Return,
DynamicBoundary {
kind: PirDynamicBoundaryKind,
reason: String,
},
}Expand description
A modeled PIR operation.
Operations model data access, calls, and control flow without executing Perl. Families that the current HIR substrate cannot prove (for example branch and loop conditions, or explicit returns) are part of the contract but are populated by later lowering passes; receipts make the gap visible.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LexicalRead
Read a lexical variable.
Fields
name: LexicalNameThe lexical being read.
LexicalWrite
Write (declare or assign) a lexical variable.
Fields
name: LexicalNameThe lexical being written.
StashRead
Read a package/stash symbol.
Fields
symbol: SymbolNameThe symbol being read.
StashWrite
Write a package/stash symbol.
Fields
symbol: SymbolNameThe symbol being written.
Modify
Compound read-modify-write on a lexical variable (+=, -=, ++, etc.).
The place is evaluated exactly once. The compound operator is preserved in
op so downstream analyses can distinguish += from ++ without re-parsing.
Fields
name: LexicalNameThe lexical variable being modified.
StashModify
Compound read-modify-write on a package/stash symbol.
Mirrors Modify for package slots.
Assign
An assignment expression.
Call
A subroutine or function call.
MethodCall
A method call.
Fields
receiver: PirReceiverThe receiver.
Branch
A branch (condition is populated by later control-flow lowering).
Loop
A loop (condition is populated by later control-flow lowering).
Return
A return from the enclosing subroutine.
DynamicBoundary
A preserved dynamic boundary.
Fields
kind: PirDynamicBoundaryKindBoundary category.
Implementations§
Source§impl PirOperation
impl PirOperation
Sourcepub const ALL_OPERATION_NAMES: &[&'static str]
pub const ALL_OPERATION_NAMES: &[&'static str]
All operation-family names PIR v0 models.
Receipts and status generators should use this list instead of keeping a separate copy of the current PIR operation surface.
Trait Implementations§
Source§impl Clone for PirOperation
impl Clone for PirOperation
Source§fn clone(&self) -> PirOperation
fn clone(&self) -> PirOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PirOperation
impl Debug for PirOperation
impl Eq for PirOperation
Source§impl PartialEq for PirOperation
impl PartialEq for PirOperation
Source§fn eq(&self, other: &PirOperation) -> bool
fn eq(&self, other: &PirOperation) -> bool
self and other values to be equal, and is used by ==.