Skip to content

Commit

Permalink
Clarify how branching works in a CFG
Browse files Browse the repository at this point in the history
  • Loading branch information
camelid committed Sep 15, 2020
1 parent fd79ed4 commit a872ec4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,9 +1079,11 @@ rustc_index::newtype_index! {
/// 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
/// it easier to do [data-flow analyses] and optimizations. Basic blocks consist of a series of
/// [statements][`Statement`], ending with a [terminator][`Terminator`]. Basic blocks can have
/// multiple predecessors and successors.
/// it easier to do [data-flow analyses] and optimizations. Instead, branches are represented
/// as an edge in a graph between basic blocks.
///
/// 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].
///
Expand Down

0 comments on commit a872ec4

Please sign in to comment.