Skip to content

Commit 57eb29c

Browse files
committed
Update based on review suggestions
1 parent c051f61 commit 57eb29c

File tree

1 file changed

+6
-2
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+6
-2
lines changed

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,20 +1076,24 @@ pub struct VarDebugInfo<'tcx> {
10761076
// BasicBlock
10771077

10781078
rustc_index::newtype_index! {
1079-
/// The unit of the MIR [control-flow graph][CFG].
1079+
/// A node in the MIR [control-flow graph][CFG].
10801080
///
10811081
/// There are no branches (e.g., `if`s, function calls, etc.) within a basic block, which makes
10821082
/// it easier to do [data-flow analyses] and optimizations. Instead, branches are represented
10831083
/// as an edge in a graph between basic blocks.
10841084
///
10851085
/// Basic blocks consist of a series of [statements][Statement], ending with a
1086-
/// [terminator][Terminator]. Basic blocks can have multiple predecessors and successors.
1086+
/// [terminator][Terminator]. Basic blocks can have multiple predecessors and successors,
1087+
/// however there is a MIR pass ([`CriticalCallEdges`]) that removes *critical edges*, which
1088+
/// are edges that go from a multi-successor node to a multi-predecessor node. This pass is
1089+
/// needed because some analyses require that there are no critical edges in the CFG.
10871090
///
10881091
/// Read more about basic blocks in the [rustc-dev-guide][guide-mir].
10891092
///
10901093
/// [CFG]: https://rustc-dev-guide.rust-lang.org/appendix/background.html#cfg
10911094
/// [data-flow analyses]:
10921095
/// https://rustc-dev-guide.rust-lang.org/appendix/background.html#what-is-a-dataflow-analysis
1096+
/// [`CriticalCallEdges`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/transform/add_call_guards/enum.AddCallGuards.html#variant.CriticalCallEdges
10931097
/// [guide-mir]: https://rustc-dev-guide.rust-lang.org/mir/
10941098
pub struct BasicBlock {
10951099
derive [HashStable]

0 commit comments

Comments
 (0)