1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use std::collections::HashSet;
use cairo_lang_diagnostics::Maybe;
use cairo_lang_semantic::ConcreteFunctionWithBodyId;
use cairo_lang_utils::graph_algos::feedback_set::calc_feedback_set;
use super::concrete_function_node::ConcreteFunctionWithBodyNode;
use crate::db::{ConcreteSCCRepresentative, LoweringGroup};
pub fn function_with_body_feedback_set(
db: &dyn LoweringGroup,
function: ConcreteFunctionWithBodyId,
) -> Maybe<HashSet<ConcreteFunctionWithBodyId>> {
let r = db.concrete_function_with_body_scc_representative(function);
db.priv_function_with_body_feedback_set_of_representative(r)
}
pub fn priv_function_with_body_feedback_set_of_representative(
db: &dyn LoweringGroup,
function: ConcreteSCCRepresentative,
) -> Maybe<HashSet<ConcreteFunctionWithBodyId>> {
Ok(calc_feedback_set(&ConcreteFunctionWithBodyNode { function_id: function.0, db }.into()))
}