Crate paralegal_spdg
source ·Expand description
This crate defines the program dependence graph (PDG) generated by Paralegal.
The top-level type is ProgramDescription
. This type references multiple
types defined within the Rust compiler such as MIR locations. To avoid requiring
a rustc_private
dependency on paralegal_spdg clients, we provide proxies in the
rustc_proxies
module for all Rustc types within the PDG.
Re-exports
pub use node_cluster::NodeCluster;
Modules
- Display SPDGs as dot graphs
- Collections of nodes in a single controller
- rustc 🔒
- Exports either rustc identifiers or their proxies depending on whether the
rustc
feature is enabled. - Proxies for Rustc types used within the PDG.
- Canonical serialziation to use. This is so that
paralegal-flow
andparalegal-policy
agree on the format to use. - Serialization that is readable. Serializes the set as a list of integers (that are set to one).
- Utilities for traversing an SPDG
- Utility functions and structs
Structs
- A location within the global call-graph.
- Exported information from rustc about what sort of object a
DefId
points to. - A structure with a
Display
implementation that shows information about a node index in a given graph. - Provides a way to format rust paths
- Metadata for an edge in the
SPDGImpl
- Metadata on a function call.
- The global version of an edge that is tied to some specific entrypoint
- A
RichLocation
within a specific point in a codebase. - A globally identified node in an SPDG
- Return type of
IntoIterGlobalNodes::iter_global_nodes
. - A hash map implemented with quadratic probing and SIMD lookup.
- An identifier for any kind of object (functions, markers, etc.).
- Information about an instruction represented in the PDG
- A marker annotation and its refinements.
- Node metadata in the
SPDGImpl
- The annotated program dependence graph.
- A semantic PDG, e.g. a graph plus marker annotations
- Statistics about the code that produced an SPDG
- Create a hash for this object that is no longer than six hex digits
- An interned
SourceFileInfo
- Information about a source file
- Encodes a source code location
- A “point” within a source file. Used to compose and compare spans.
- A bit-set implemented with a
u16
, supporting domains up to 16 elements. - Metadata about a type
- Holds
TypeId
s that were assigned to a node.
Enums
- Similar to
DefKind
in rustc but not the same! - The type of an edge
- The type of instructions we may encounter
- Extends a MIR body’s
Location
withStart
(before the first instruction) andEnd
(after all returns). - Additional information about the source of data.
- Additional information about this mutation.
Constants
- Name of the file used for emitting the serialized
ProgramDescription
.
Traits
- This lets us be agnostic whether a primitive (such as
flows_to
) is called with aGlobalNode
or&NodeCluster
.
Functions
- Calculate a hash for this object