Skip to main content

Module pdg

Module pdg 

Source
Expand description

Environment variables the front end passes to the driver. Control dependence for a function’s program dependence graph (Ferrante, Ottenstein and Warren, 1987).

A node n is control dependent on the edge a -> b when b leads to n on every path to the exit (n post-dominates b), but a does not (n does not post-dominate a): the branch at a decides whether n runs. Post-dominators are dominators of the reversed graph, from a virtual exit that every exit block leads to (Cooper, Harvey and Kennedy’s iterative algorithm).

Re-exports§

use serde::Deserialize; 🔒
use serde::Deserialize; 🔒
use serde::Serialize; 🔒
use serde::Serialize; 🔒

Structs§

Cfg
A control-flow graph: succ[n] are the blocks n may jump to, each with a label for the edge (true, Err, otherwise). Blocks without successors are exits.
CratePdg
FnPdg
The dependence graph of one body (a function, closure or async block).
Guard
One control dependence: the block runs only when the branch at branch takes the edge labelled label.
NaturalLoop
A natural loop: the blocks that can reach a back edge latch -> header without passing through header.
PdgBranch
A branch: where it is and what it tests.
PdgChain
One chain of a join the macro generated: a closure or async block of its own, whose graph is listed under path.
PdgEntry
An entry point: a function the outside world calls, so the place to start tracing from.
PdgJoin
Chains that run concurrently: one join of the rewritten function.
PdgLoop
A loop of a body: how often it runs, what runs inside it, and where it is left.
PdgNode
A point of interest in a function: a call with effects or a call of the crate’s own code, an await, or a return.
PdgPrefetch
A prefetched loop: path (the prefix) runs for later items while earlier ones finish.
PdgSelect
A select! or join! written in the body: futures polled together at one await. For select!, the first to finish wins and the others are dropped where they stopped.

Functions§

control_dependence
The guards of each block: the branches it is control dependent on.
natural_loops
The natural loops of cfg reachable from root, one per header (loops that share a header are merged), outermost first.
post_dominators
The immediate post-dominator of each block: Some(n) for a block, None for the virtual exit (the block is an exit, or every path from it ends there directly) or for a block from which no exit is reachable.
render
A function’s graph as text: each node with the branches it depends on.
render_entry
An entry as one line: axum get /users -> api::list_users (line 12, registered at line 40).