提交 fd79ed42 编写于 作者: C Camelid

Add docs for `BasicBlock`

上级 255ceeb5
......@@ -1076,6 +1076,19 @@ pub struct VarDebugInfo<'tcx> {
// BasicBlock
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.
///
/// 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
/// [guide-mir]: https://rustc-dev-guide.rust-lang.org/mir/
pub struct BasicBlock {
derive [HashStable]
DEBUG_FORMAT = "bb{}",
......@@ -1092,6 +1105,7 @@ pub fn start_location(self) -> Location {
///////////////////////////////////////////////////////////////////////////
// BasicBlockData and Terminator
/// See [`BasicBlock`] for documentation on what basic blocks are at a high level.
#[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable)]
pub struct BasicBlockData<'tcx> {
/// List of statements in this block.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册