pub trait NodeQueries<'a>: IntoIterGlobalNodeswhere
    Self::Iter: 'a,{
    // Provided methods
    fn siblings(self, ctx: &Context) -> NodeCluster { ... }
    fn flows_to(
        self,
        sink: impl IntoIterGlobalNodes,
        ctx: &Context,
        edge_type: EdgeSelection
    ) -> bool { ... }
    fn consuming_call_sites(
        self,
        ctx: &'a Context
    ) -> Box<dyn Iterator<Item = CallString> + 'a> { ... }
    fn has_ctrl_influence(
        self,
        target: impl IntoIterGlobalNodes + Sized + Copy,
        ctx: &Context
    ) -> bool { ... }
    fn influencers(
        self,
        ctx: &Context,
        edge_type: EdgeSelection
    ) -> Vec<GlobalNode> { ... }
    fn influencees(
        self,
        ctx: &Context,
        edge_type: EdgeSelection
    ) -> Vec<GlobalNode> { ... }
}
Expand description

Context queries conveniently accessible on nodes

Provided Methods§

source

fn siblings(self, ctx: &Context) -> NodeCluster

Get other nodes at the same instruction

source

fn flows_to( self, sink: impl IntoIterGlobalNodes, ctx: &Context, edge_type: EdgeSelection ) -> bool

Returns whether a node flows to a node through the configured edge type.

Nodes do not flow to themselves. CallArgument nodes do flow to their respective CallSites.

If you use flows_to with EdgeSelection::Control, you might want to consider using Context::has_ctrl_influence, which additionally considers intermediate nodes which the src node has data flow to and has ctrl influence on the sink.

source

fn consuming_call_sites( self, ctx: &'a Context ) -> Box<dyn Iterator<Item = CallString> + 'a>

Call sites that consume this node directly. E.g. the outgoing edges.

source

fn has_ctrl_influence( self, target: impl IntoIterGlobalNodes + Sized + Copy, ctx: &Context ) -> bool

Returns whether there is direct control flow influence from influencer to sink, or there is some node which is data-flow influenced by influencer and has direct control flow influence on target. Or as expressed in code:

some n where self.flows_to(influencer, n, EdgeSelection::Data) && self.flows_to(n, target, EdgeSelection::Control).

source

fn influencers(self, ctx: &Context, edge_type: EdgeSelection) -> Vec<GlobalNode>

Returns iterator over all Nodes that influence the given sink Node.

Does not return the input node. A CallSite sink will return all of the associated CallArgument nodes.

source

fn influencees(self, ctx: &Context, edge_type: EdgeSelection) -> Vec<GlobalNode>

Returns iterator over all Nodes that are influenced by the given src Node.

Does not return the input node. A CallArgument src will return the associated CallSite.

Implementors§

source§

impl<'a, T: IntoIterGlobalNodes + 'a> NodeQueries<'a> for T