Skip to content

Commit ed7c30b

Browse files
committed
rework MIR visitor
We now visit more things (e.g., types) and also follow a deliberate style designed to reduce omissions.
1 parent 0769865 commit ed7c30b

File tree

2 files changed

+382
-26
lines changed

2 files changed

+382
-26
lines changed

src/librustc/mir/repr.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,23 @@ impl Debug for BasicBlock {
233233

234234
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
235235
pub struct BasicBlockData<'tcx> {
236+
/// List of statements in this block.
236237
pub statements: Vec<Statement<'tcx>>,
238+
239+
/// Terminator for this block.
240+
///
241+
/// NB. This should generally ONLY be `None` during construction.
242+
/// Therefore, you should generally access it via the
243+
/// `terminator()` or `terminator_mut()` methods. The only
244+
/// exception is that certain passes, such as `simplify_cfg`, swap
245+
/// out the terminator temporarily with `None` while they continue
246+
/// to recurse over the set of basic blocks.
237247
pub terminator: Option<Terminator<'tcx>>,
248+
249+
/// If true, this block lies on an unwind path. This is used
250+
/// during trans where distinct kinds of basic blocks may be
251+
/// generated (particularly for MSVC cleanup). Unwind blocks must
252+
/// only branch to other unwind blocks.
238253
pub is_cleanup: bool,
239254
}
240255

0 commit comments

Comments
 (0)