1
Fork 0

Clarify how branching works in a CFG

This commit is contained in:
Camelid 2020-09-14 20:10:29 -07:00
parent fd79ed4225
commit a872ec4714

View file

@ -1079,9 +1079,11 @@ rustc_index::newtype_index! {
/// The unit of the MIR [control-flow graph][CFG]. /// The unit of the MIR [control-flow graph][CFG].
/// ///
/// There is no branching (e.g., `if`s, function calls, etc.) within a basic block, which makes /// There is no branching (e.g., `if`s, function calls, etc.) within a basic block, which makes
/// it easier to do [data-flow analyses] and optimizations. Basic blocks consist of a series of /// it easier to do [data-flow analyses] and optimizations. Instead, branches are represented
/// [statements][`Statement`], ending with a [terminator][`Terminator`]. Basic blocks can have /// as an edge in a graph between basic blocks.
/// multiple predecessors and successors. ///
/// Basic blocks consist of a series of [statements][`Statement`], ending with a
/// [terminator][`Terminator`]. Basic blocks can have multiple predecessors and successors.
/// ///
/// Read more about basic blocks in the [rustc-dev-guide][guide-mir]. /// Read more about basic blocks in the [rustc-dev-guide][guide-mir].
/// ///