diff --git a/src/librustc_mir/transform/add_yk_swt_calls.rs b/src/librustc_mir/transform/add_yk_swt_calls.rs index 7560d04115d..e7b3a809f45 100644 --- a/src/librustc_mir/transform/add_yk_swt_calls.rs +++ b/src/librustc_mir/transform/add_yk_swt_calls.rs @@ -22,8 +22,8 @@ use rustc::hir::map::blocks::FnLikeNode; /// The arguments to the calls (crate hash, DefId and block index) identify the position to be /// inserted into a trace. /// -/// The transformation works by copying each block and replacing the original with a new block -- -/// its "shadow" -- which calls the trace recorder function, before returning to the copy. +/// The transformation works by copying each original "user block" and replacing it with a new +/// block -- its "shadow" -- which calls the trace recorder function, before returning to the copy. /// /// For example: /// @@ -32,8 +32,8 @@ use rustc::hir::map::blocks::FnLikeNode; /// +----+ +----+ +-----+ +-----+ +----+ +-----+ +-----+ +----+ /// /// Where: -/// * B0 and B1 are blocks in the MIR before transformation. -/// * B0' and B1' are replacements of B0 and B1 respectively. +/// * B0 and B1 are "user blocks" in the MIR before the transformation. +/// * B0' and B1' are "shadow blocks" of B0 and B1 respectively. /// * B2 and B3 are copies of B0 and B1 respectively. /// * 'Rec' is the trace recorder function. /// * The block indices match the indices in the backing vector in the MIR. @@ -59,7 +59,7 @@ impl MirPass for AddYkSWTCalls { let u64_ty = tcx.types.u64; let mut shadow_blks = Vec::new(); - let mut copied_blks = Vec::new(); + let mut user_blks = Vec::new(); // Copies of the blocks we started with. let mut new_local_decls = Vec::new(); let num_orig_local_decls = mir.local_decls.len(); @@ -68,8 +68,8 @@ impl MirPass for AddYkSWTCalls { for (bb, bb_data) in mir.basic_blocks().iter_enumerated() { // Copy the block. let new_blk = bb_data.clone(); - let new_blk_idx = BasicBlock::new(mir.basic_blocks().len() + copied_blks.len()); - copied_blks.push(new_blk); + let new_blk_idx = BasicBlock::new(mir.basic_blocks().len() + user_blks.len()); + user_blks.push(new_blk); // Prepare to call the recorder function. let ret_val = LocalDecl::new_temp(unit_ty, DUMMY_SP); @@ -123,7 +123,7 @@ impl MirPass for AddYkSWTCalls { } // Finally, commit our transformations. - mir.basic_blocks_mut().extend(copied_blks); + mir.basic_blocks_mut().extend(user_blks); mir.local_decls.extend(new_local_decls); for (bb, bb_data) in shadow_blks.drain(..).enumerate() { mir.basic_blocks_mut()[BasicBlock::new(bb)] = bb_data;