Trait cairo_lang_lowering::db::LoweringGroup
source · pub trait LoweringGroup: Database + HasQueryGroup<LoweringDatabase> + SemanticGroup + Upcast<dyn SemanticGroup> {
Show 43 methods
// Required methods
fn intern_lowering_function(&self, key0: FunctionLongId) -> FunctionId;
fn lookup_intern_lowering_function(
&self,
key0: FunctionId
) -> FunctionLongId;
fn intern_lowering_concrete_function_with_body(
&self,
key0: ConcreteFunctionWithBodyLongId
) -> ConcreteFunctionWithBodyId;
fn lookup_intern_lowering_concrete_function_with_body(
&self,
key0: ConcreteFunctionWithBodyId
) -> ConcreteFunctionWithBodyLongId;
fn intern_lowering_function_with_body(
&self,
key0: FunctionWithBodyLongId
) -> FunctionWithBodyId;
fn lookup_intern_lowering_function_with_body(
&self,
key0: FunctionWithBodyId
) -> FunctionWithBodyLongId;
fn intern_location(&self, key0: Location) -> LocationId;
fn lookup_intern_location(&self, key0: LocationId) -> Location;
fn priv_inline_data(
&self,
key0: FunctionWithBodyId
) -> Maybe<Arc<PrivInlineData>>;
fn priv_function_with_body_multi_lowering(
&self,
key0: FunctionWithBodyId
) -> Maybe<Arc<MultiLowering>>;
fn priv_function_with_body_lowering(
&self,
key0: FunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>;
fn function_with_body_lowering(
&self,
key0: FunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>;
fn priv_concrete_function_with_body_lowered_flat(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>;
fn priv_concrete_function_with_body_postinline_lowered(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>;
fn concrete_function_with_body_postpanic_lowered(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>;
fn concrete_function_with_body_lowered(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>;
fn concrete_function_with_body_postinline_direct_callees(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<FunctionId>>;
fn concrete_function_with_body_postpanic_direct_callees(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<FunctionId>>;
fn concrete_function_with_body_direct_callees(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<FunctionId>>;
fn concrete_function_with_body_direct_callees_with_body(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<ConcreteFunctionWithBodyId>>;
fn concrete_function_with_body_postinline_direct_callees_with_body(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<ConcreteFunctionWithBodyId>>;
fn concrete_function_with_body_postpanic_direct_callees_with_body(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<ConcreteFunctionWithBodyId>>;
fn function_with_body_lowering_diagnostics(
&self,
key0: FunctionWithBodyId
) -> Maybe<Diagnostics<LoweringDiagnostic>>;
fn semantic_function_with_body_lowering_diagnostics(
&self,
key0: FunctionWithBodyId
) -> Maybe<Diagnostics<LoweringDiagnostic>>;
fn module_lowering_diagnostics(
&self,
key0: ModuleId
) -> Maybe<Diagnostics<LoweringDiagnostic>>;
fn file_lowering_diagnostics(
&self,
key0: FileId
) -> Maybe<Diagnostics<LoweringDiagnostic>>;
fn function_implicits(&self, key0: FunctionId) -> Maybe<Vec<TypeId>>;
fn scc_implicits(
&self,
key0: ConcreteSCCRepresentative
) -> Maybe<Vec<TypeId>>;
fn function_may_panic(&self, key0: FunctionId) -> Maybe<bool>;
fn scc_may_panic(&self, key0: ConcreteSCCRepresentative) -> Maybe<bool>;
fn has_direct_panic(&self, key0: ConcreteFunctionWithBodyId) -> Maybe<bool>;
fn function_with_body_direct_callees(
&self,
key0: FunctionWithBodyId
) -> Maybe<OrderedHashSet<FunctionId>>;
fn function_with_body_direct_function_with_body_callees(
&self,
key0: FunctionWithBodyId
) -> Maybe<OrderedHashSet<FunctionWithBodyId>>;
fn contains_cycle(&self, key0: ConcreteFunctionWithBodyId) -> Maybe<bool>;
fn in_cycle(&self, key0: FunctionWithBodyId) -> Maybe<bool>;
fn concrete_function_with_body_scc_representative(
&self,
key0: ConcreteFunctionWithBodyId
) -> ConcreteSCCRepresentative;
fn concrete_function_with_body_scc(
&self,
key0: ConcreteFunctionWithBodyId
) -> Vec<ConcreteFunctionWithBodyId>;
fn concrete_function_with_body_scc_postpanic_representative(
&self,
key0: ConcreteFunctionWithBodyId
) -> ConcreteSCCRepresentative;
fn concrete_function_with_body_postpanic_scc(
&self,
key0: ConcreteFunctionWithBodyId
) -> Vec<ConcreteFunctionWithBodyId>;
fn function_with_body_scc(
&self,
key0: FunctionWithBodyId
) -> Vec<FunctionWithBodyId>;
fn function_with_body_feedback_set(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<OrderedHashSet<ConcreteFunctionWithBodyId>>;
fn needs_withdraw_gas(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<bool>;
fn priv_function_with_body_feedback_set_of_representative(
&self,
key0: ConcreteSCCRepresentative
) -> Maybe<OrderedHashSet<ConcreteFunctionWithBodyId>>;
}
Required Methods§
fn intern_lowering_function(&self, key0: FunctionLongId) -> FunctionId
fn lookup_intern_lowering_function(&self, key0: FunctionId) -> FunctionLongId
fn intern_lowering_concrete_function_with_body( &self, key0: ConcreteFunctionWithBodyLongId ) -> ConcreteFunctionWithBodyId
fn lookup_intern_lowering_concrete_function_with_body( &self, key0: ConcreteFunctionWithBodyId ) -> ConcreteFunctionWithBodyLongId
fn intern_lowering_function_with_body( &self, key0: FunctionWithBodyLongId ) -> FunctionWithBodyId
fn lookup_intern_lowering_function_with_body( &self, key0: FunctionWithBodyId ) -> FunctionWithBodyLongId
fn intern_location(&self, key0: Location) -> LocationId
fn lookup_intern_location(&self, key0: LocationId) -> Location
fn priv_inline_data( &self, key0: FunctionWithBodyId ) -> Maybe<Arc<PrivInlineData>>
sourcefn priv_function_with_body_multi_lowering(
&self,
key0: FunctionWithBodyId
) -> Maybe<Arc<MultiLowering>>
fn priv_function_with_body_multi_lowering( &self, key0: FunctionWithBodyId ) -> Maybe<Arc<MultiLowering>>
Computes the lowered representation of a function with a body, along with all it generated functions (e.g. closures, lambdas, loops, …).
sourcefn priv_function_with_body_lowering(
&self,
key0: FunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>
fn priv_function_with_body_lowering( &self, key0: FunctionWithBodyId ) -> Maybe<Arc<FlatLowered>>
Computes the lowered representation of a function with a body before borrow checking.
sourcefn function_with_body_lowering(
&self,
key0: FunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>
fn function_with_body_lowering( &self, key0: FunctionWithBodyId ) -> Maybe<Arc<FlatLowered>>
Computes the lowered representation of a function with a body.
sourcefn priv_concrete_function_with_body_lowered_flat(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>
fn priv_concrete_function_with_body_lowered_flat( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Arc<FlatLowered>>
A concrete version of priv_function_with_body_multi_lowering
sourcefn priv_concrete_function_with_body_postinline_lowered(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>
fn priv_concrete_function_with_body_postinline_lowered( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Arc<FlatLowered>>
Computes the lowered representation after the inlining phase.
sourcefn concrete_function_with_body_postpanic_lowered(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>
fn concrete_function_with_body_postpanic_lowered( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Arc<FlatLowered>>
Computes the lowered representation after the panic phase.
sourcefn concrete_function_with_body_lowered(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Arc<FlatLowered>>
fn concrete_function_with_body_lowered( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Arc<FlatLowered>>
Computes the final lowered representation (after all the internal transformations).
sourcefn concrete_function_with_body_postinline_direct_callees(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<FunctionId>>
fn concrete_function_with_body_postinline_direct_callees( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Vec<FunctionId>>
Returns the set of direct callees of a concrete function with a body after the inline phase.
sourcefn concrete_function_with_body_postpanic_direct_callees(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<FunctionId>>
fn concrete_function_with_body_postpanic_direct_callees( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Vec<FunctionId>>
Returns the set of direct callees of a concrete function with a body after the panic phase.
sourcefn concrete_function_with_body_direct_callees(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<FunctionId>>
fn concrete_function_with_body_direct_callees( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Vec<FunctionId>>
Returns the set of direct callees of a concrete function with a body.
sourcefn concrete_function_with_body_direct_callees_with_body(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<ConcreteFunctionWithBodyId>>
fn concrete_function_with_body_direct_callees_with_body( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Vec<ConcreteFunctionWithBodyId>>
Returns the set of direct callees which are functions with body of a concrete function with a body (i.e. excluding libfunc callees).
sourcefn concrete_function_with_body_postinline_direct_callees_with_body(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<ConcreteFunctionWithBodyId>>
fn concrete_function_with_body_postinline_direct_callees_with_body( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Vec<ConcreteFunctionWithBodyId>>
Returns the set of direct callees which are functions with body of a concrete function with a body (i.e. excluding libfunc callees), after the inline phase.
sourcefn concrete_function_with_body_postpanic_direct_callees_with_body(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<Vec<ConcreteFunctionWithBodyId>>
fn concrete_function_with_body_postpanic_direct_callees_with_body( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<Vec<ConcreteFunctionWithBodyId>>
Returns the set of direct callees which are functions with body of a concrete function with a body (i.e. excluding libfunc callees), after the panic phase.
sourcefn function_with_body_lowering_diagnostics(
&self,
key0: FunctionWithBodyId
) -> Maybe<Diagnostics<LoweringDiagnostic>>
fn function_with_body_lowering_diagnostics( &self, key0: FunctionWithBodyId ) -> Maybe<Diagnostics<LoweringDiagnostic>>
Aggregates function level lowering diagnostics.
sourcefn semantic_function_with_body_lowering_diagnostics(
&self,
key0: FunctionWithBodyId
) -> Maybe<Diagnostics<LoweringDiagnostic>>
fn semantic_function_with_body_lowering_diagnostics( &self, key0: FunctionWithBodyId ) -> Maybe<Diagnostics<LoweringDiagnostic>>
Aggregates semantic function level lowering diagnostics - along with all its generated function.
sourcefn module_lowering_diagnostics(
&self,
key0: ModuleId
) -> Maybe<Diagnostics<LoweringDiagnostic>>
fn module_lowering_diagnostics( &self, key0: ModuleId ) -> Maybe<Diagnostics<LoweringDiagnostic>>
Aggregates module level lowering diagnostics.
sourcefn file_lowering_diagnostics(
&self,
key0: FileId
) -> Maybe<Diagnostics<LoweringDiagnostic>>
fn file_lowering_diagnostics( &self, key0: FileId ) -> Maybe<Diagnostics<LoweringDiagnostic>>
Aggregates file level lowering diagnostics.
sourcefn function_implicits(&self, key0: FunctionId) -> Maybe<Vec<TypeId>>
fn function_implicits(&self, key0: FunctionId) -> Maybe<Vec<TypeId>>
Returns all the implicit parameters that the function requires (according to both its signature and the functions it calls). The items in the returned vector are unique and the order is consistent, but not necessarily related to the order of the explicit implicits in the signature of the function.
sourcefn scc_implicits(&self, key0: ConcreteSCCRepresentative) -> Maybe<Vec<TypeId>>
fn scc_implicits(&self, key0: ConcreteSCCRepresentative) -> Maybe<Vec<TypeId>>
Returns all the implicits used by a strongly connected component of functions.
sourcefn function_may_panic(&self, key0: FunctionId) -> Maybe<bool>
fn function_may_panic(&self, key0: FunctionId) -> Maybe<bool>
Returns whether the function may panic.
sourcefn scc_may_panic(&self, key0: ConcreteSCCRepresentative) -> Maybe<bool>
fn scc_may_panic(&self, key0: ConcreteSCCRepresentative) -> Maybe<bool>
Returns whether any function in the strongly connected component may panic.
sourcefn has_direct_panic(&self, key0: ConcreteFunctionWithBodyId) -> Maybe<bool>
fn has_direct_panic(&self, key0: ConcreteFunctionWithBodyId) -> Maybe<bool>
Checks if the function has a block that ends with panic.
sourcefn function_with_body_direct_callees(
&self,
key0: FunctionWithBodyId
) -> Maybe<OrderedHashSet<FunctionId>>
fn function_with_body_direct_callees( &self, key0: FunctionWithBodyId ) -> Maybe<OrderedHashSet<FunctionId>>
Returns the set of direct callees of a function with a body.
sourcefn function_with_body_direct_function_with_body_callees(
&self,
key0: FunctionWithBodyId
) -> Maybe<OrderedHashSet<FunctionWithBodyId>>
fn function_with_body_direct_function_with_body_callees( &self, key0: FunctionWithBodyId ) -> Maybe<OrderedHashSet<FunctionWithBodyId>>
Returns the set of direct callees which are functions with body of a function with a body (i.e. excluding libfunc callees).
sourcefn contains_cycle(&self, key0: ConcreteFunctionWithBodyId) -> Maybe<bool>
fn contains_cycle(&self, key0: ConcreteFunctionWithBodyId) -> Maybe<bool>
Returns true
if the function calls (possibly indirectly) itself, or if it calls (possibly
indirectly) such a function. For example, if f0 calls f1, f1 calls f2, f2 calls f3, and f3
calls f2, then Self::contains_cycle will return true
for all of these functions.
sourcefn in_cycle(&self, key0: FunctionWithBodyId) -> Maybe<bool>
fn in_cycle(&self, key0: FunctionWithBodyId) -> Maybe<bool>
Returns true
if the function calls (possibly indirectly) itself. For example, if f0 calls
f1, f1 calls f2, f2 calls f3, and f3 calls f2, then Self::in_cycle will return
true
for f2 and f3, but false for f0 and f1.
sourcefn concrete_function_with_body_scc_representative(
&self,
key0: ConcreteFunctionWithBodyId
) -> ConcreteSCCRepresentative
fn concrete_function_with_body_scc_representative( &self, key0: ConcreteFunctionWithBodyId ) -> ConcreteSCCRepresentative
Returns the representative of the concrete function’s strongly connected component. The representative is consistently chosen for all the concrete functions in the same SCC.
sourcefn concrete_function_with_body_scc(
&self,
key0: ConcreteFunctionWithBodyId
) -> Vec<ConcreteFunctionWithBodyId>
fn concrete_function_with_body_scc( &self, key0: ConcreteFunctionWithBodyId ) -> Vec<ConcreteFunctionWithBodyId>
Returns all the concrete functions in the same strongly connected component as the given concrete function.
sourcefn concrete_function_with_body_scc_postpanic_representative(
&self,
key0: ConcreteFunctionWithBodyId
) -> ConcreteSCCRepresentative
fn concrete_function_with_body_scc_postpanic_representative( &self, key0: ConcreteFunctionWithBodyId ) -> ConcreteSCCRepresentative
Returns the representative of the concrete function’s strongly connected component. The representative is consistently chosen for all the concrete functions in the same SCC. This is using the representation after the panic phase.
sourcefn concrete_function_with_body_postpanic_scc(
&self,
key0: ConcreteFunctionWithBodyId
) -> Vec<ConcreteFunctionWithBodyId>
fn concrete_function_with_body_postpanic_scc( &self, key0: ConcreteFunctionWithBodyId ) -> Vec<ConcreteFunctionWithBodyId>
Returns all the concrete functions in the same strongly connected component as the given concrete function. This is using the representation after the panic phase.
sourcefn function_with_body_scc(
&self,
key0: FunctionWithBodyId
) -> Vec<FunctionWithBodyId>
fn function_with_body_scc( &self, key0: FunctionWithBodyId ) -> Vec<FunctionWithBodyId>
Returns all the functions in the same strongly connected component as the given function.
sourcefn function_with_body_feedback_set(
&self,
key0: ConcreteFunctionWithBodyId
) -> Maybe<OrderedHashSet<ConcreteFunctionWithBodyId>>
fn function_with_body_feedback_set( &self, key0: ConcreteFunctionWithBodyId ) -> Maybe<OrderedHashSet<ConcreteFunctionWithBodyId>>
Returns the feedback-vertex-set of the given concrete function. A feedback-vertex-set is the set of vertices whose removal leaves a graph without cycles.
sourcefn needs_withdraw_gas(&self, key0: ConcreteFunctionWithBodyId) -> Maybe<bool>
fn needs_withdraw_gas(&self, key0: ConcreteFunctionWithBodyId) -> Maybe<bool>
Returns whether the given function needs an additional withdraw_gas call.
sourcefn priv_function_with_body_feedback_set_of_representative(
&self,
key0: ConcreteSCCRepresentative
) -> Maybe<OrderedHashSet<ConcreteFunctionWithBodyId>>
fn priv_function_with_body_feedback_set_of_representative( &self, key0: ConcreteSCCRepresentative ) -> Maybe<OrderedHashSet<ConcreteFunctionWithBodyId>>
Returns the feedback-vertex-set of the given concrete-function SCC-representative. A feedback-vertex-set is the set of vertices whose removal leaves a graph without cycles.