pub struct CallGraph {
pub nodes: BTreeSet<DefinitionId>,
pub edges: BTreeMap<DefinitionId, BTreeSet<DefinitionId>>,
}Expand description
A directed call graph over inferable definitions.
PartialEq/Eq (FG-2, issue #631): the salsa cutoff for
call_graph_query in brink-db — an edit that leaves every def’s call
targets unchanged leaves this equal, so scc_membership_query and every
solve_scc_query backdate instead of re-executing.
Fields§
§nodes: BTreeSet<DefinitionId>§edges: BTreeMap<DefinitionId, BTreeSet<DefinitionId>>caller -> { callees }.
Implementations§
Source§impl CallGraph
impl CallGraph
pub fn new() -> Self
pub fn add_node(&mut self, def: DefinitionId)
Sourcepub fn add_edge(&mut self, from: DefinitionId, to: DefinitionId)
pub fn add_edge(&mut self, from: DefinitionId, to: DefinitionId)
Record a resolved call/divert-target edge. Both endpoints are added
as nodes if not already present (a call to a def with no
inferable body of its own — e.g. an external — is simply never added
as a node by the caller, so no edge is recorded for it; see
infer_project’s node-selection pass).
Trait Implementations§
impl Eq for CallGraph
impl StructuralPartialEq for CallGraph
Auto Trait Implementations§
impl Freeze for CallGraph
impl RefUnwindSafe for CallGraph
impl Send for CallGraph
impl Sync for CallGraph
impl Unpin for CallGraph
impl UnsafeUnpin for CallGraph
impl UnwindSafe for CallGraph
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.