Struct paralegal_spdg::SPDG
source · pub struct SPDG {
pub name: Identifier,
pub path: Box<[Identifier]>,
pub id: Endpoint,
pub graph: SPDGImpl,
pub markers: HashMap<Node, Box<[Identifier]>>,
pub arguments: Box<[Node]>,
pub return_: Box<[Node]>,
pub type_assigns: HashMap<Node, Types>,
pub statistics: SPDGStats,
}
Expand description
A semantic PDG, e.g. a graph plus marker annotations
Fields§
§name: Identifier
The identifier of the entry point to this computation
path: Box<[Identifier]>
The module path to this controller function
id: Endpoint
The id
graph: SPDGImpl
The PDG
markers: HashMap<Node, Box<[Identifier]>>
Nodes to which markers are assigned.
arguments: Box<[Node]>
The nodes that represent arguments to the entrypoint
return_: Box<[Node]>
If the return is ()
or !
then this is None
type_assigns: HashMap<Node, Types>
Stores the assignment of relevant (e.g. marked) types to nodes. Node that this contains multiple types for a single node, because it hold top-level types and subtypes that may be marked.
statistics: SPDGStats
Statistics
Implementations§
source§impl SPDG
impl SPDG
sourcepub fn data_sinks(&self) -> impl Iterator<Item = Node> + '_
pub fn data_sinks(&self) -> impl Iterator<Item = Node> + '_
Returns an iterator over all the data sinks in the data_flow
relation.
sourcepub fn edges(&self) -> impl Iterator<Item = EdgeReference<'_, EdgeInfo>> + '_
pub fn edges(&self) -> impl Iterator<Item = EdgeReference<'_, EdgeInfo>> + '_
An iterator over all edges in this graph.
sourcepub fn all_sources(&self) -> impl Iterator<Item = Node> + '_
pub fn all_sources(&self) -> impl Iterator<Item = Node> + '_
Gather all Node
s that are mentioned in this controller including data and control flow.
sourcepub fn arguments(&self) -> NodeCluster
pub fn arguments(&self) -> NodeCluster
The arguments of this spdg. The same as the arguments
field, but
conveniently paired with the controller id
sourcepub fn node_types(&self, node: Node) -> &[TypeId]
pub fn node_types(&self, node: Node) -> &[TypeId]
All types (if any) assigned to this node