about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2020-09-16 15:31:56 -0700
committerCamelid <camelidcamel@gmail.com>2020-09-16 15:31:56 -0700
commit57eb29cd2dc30c47b613ced135422a4120bc6a78 (patch)
treeeb7bf38dddf3338a4dd505bfeb4ee601fabe39ac
parentc051f61d3c078343db70e355feea808892deed75 (diff)
downloadrust-57eb29cd2dc30c47b613ced135422a4120bc6a78.tar.gz
rust-57eb29cd2dc30c47b613ced135422a4120bc6a78.zip
Update based on review suggestions
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index e6bb746f618..58b69d022d9 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -1076,20 +1076,24 @@ pub struct VarDebugInfo<'tcx> {
 // BasicBlock
 
 rustc_index::newtype_index! {
-    /// The unit of the MIR [control-flow graph][CFG].
+    /// A node in the MIR [control-flow graph][CFG].
     ///
     /// There are no branches (e.g., `if`s, function calls, etc.) within a basic block, which makes
     /// 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.
+    /// [terminator][Terminator]. Basic blocks can have multiple predecessors and successors,
+    /// however there is a MIR pass ([`CriticalCallEdges`]) that removes *critical edges*, which
+    /// are edges that go from a multi-successor node to a multi-predecessor node. This pass is
+    /// needed because some analyses require that there are no critical edges in the CFG.
     ///
     /// Read more about basic blocks in the [rustc-dev-guide][guide-mir].
     ///
     /// [CFG]: https://rustc-dev-guide.rust-lang.org/appendix/background.html#cfg
     /// [data-flow analyses]:
     ///     https://rustc-dev-guide.rust-lang.org/appendix/background.html#what-is-a-dataflow-analysis
+    /// [`CriticalCallEdges`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/transform/add_call_guards/enum.AddCallGuards.html#variant.CriticalCallEdges
     /// [guide-mir]: https://rustc-dev-guide.rust-lang.org/mir/
     pub struct BasicBlock {
         derive [HashStable]