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 blocksnmay jump to, each with a label for the edge (true,Err,otherwise). Blocks without successors are exits. - Crate
Pdg - 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
branchtakes the edge labelledlabel. - Natural
Loop - A natural loop: the blocks that can reach a back edge
latch -> headerwithout passing throughheader. - 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!orjoin!written in the body: futures polled together at one await. Forselect!, 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
cfgreachable fromroot, 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,Nonefor 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).