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_id: Option<ExprId>,
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_id: Option<ExprId>
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 LoweringContext<'_, '_>
impl LoweringContext<'_, '_>
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 new_var_usage(&mut self, req: VarRequest) -> VarUsage
pub fn new_var_usage(&mut self, req: VarRequest) -> VarUsage
Same as new_var
but returns it as a VarUsage
.
This is useful when the variable definition and usage locations are the same.
Sourcepub fn get_location(&self, stable_ptr: SyntaxStablePtrId) -> LocationId
pub fn get_location(&self, stable_ptr: SyntaxStablePtrId) -> LocationId
Retrieves the LocationId of a stable syntax pointer in the current function file.
Trait Implementations§
Source§impl<'db> Deref for LoweringContext<'_, 'db>
impl<'db> Deref for LoweringContext<'_, 'db>
Auto Trait Implementations§
impl<'a, 'db> Freeze for LoweringContext<'a, 'db>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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