Struct cairo_lang_lowering::lower::context::LoweringContext
source · pub struct LoweringContext<'a, 'db> {
pub encapsulating_ctx: Option<&'a mut EncapsulatingLoweringContext<'db>>,
pub variables: VariableAllocator<'db>,
pub signature: Signature,
pub function_id: FunctionWithBodyId,
pub concrete_function_id: ConcreteFunctionWithBodyId,
pub current_loop_expr: Option<ExprLoop>,
pub diagnostics: LoweringDiagnostics,
pub blocks: FlatBlocksBuilder,
}
Fields§
§encapsulating_ctx: Option<&'a mut EncapsulatingLoweringContext<'db>>
§variables: VariableAllocator<'db>
Variable allocator.
signature: Signature
Current function signature.
function_id: FunctionWithBodyId
Id for the current function being lowered.
concrete_function_id: ConcreteFunctionWithBodyId
Id for the current concrete function to be used when generating recursive calls. This it the generic function specialized with its own generic parameters.
current_loop_expr: Option<ExprLoop>
Current loop expression needed for recursive calls in continue
diagnostics: LoweringDiagnostics
Current emitted diagnostics.
blocks: FlatBlocksBuilder
Lowered blocks of the function.
Implementations§
source§impl<'a, 'db> LoweringContext<'a, 'db>
impl<'a, 'db> LoweringContext<'a, 'db>
pub fn new( global_ctx: &'a mut EncapsulatingLoweringContext<'db>, function_id: FunctionWithBodyId, signature: Signature ) -> Maybe<Self>where 'db: 'a,
source§impl<'a, 'db> LoweringContext<'a, 'db>
impl<'a, 'db> LoweringContext<'a, 'db>
sourcepub fn new_var(&mut self, req: VarRequest) -> VariableId
pub fn new_var(&mut self, req: VarRequest) -> VariableId
Allocates a new variable in the context’s variable arena according to the context.
sourcepub fn get_location(
&self,
stable_ptr: SyntaxStablePtrId
) -> StableLocationOption
pub fn get_location( &self, stable_ptr: SyntaxStablePtrId ) -> StableLocationOption
Retrieves the StableLocation of a stable syntax pointer in the current function file.
Trait Implementations§
source§impl<'a, 'db> Deref for LoweringContext<'a, 'db>
impl<'a, 'db> Deref for LoweringContext<'a, 'db>
Auto Trait Implementations§
impl<'a, 'db> !RefUnwindSafe for LoweringContext<'a, 'db>
impl<'a, 'db> !Send for LoweringContext<'a, 'db>
impl<'a, 'db> !Sync for LoweringContext<'a, 'db>
impl<'a, 'db> Unpin for LoweringContext<'a, 'db>
impl<'a, 'db> !UnwindSafe for LoweringContext<'a, 'db>
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