Skip to content

Commit 29a3fe3

Browse files
committed
Add some comments to Mir struct.
1 parent 2a0ce4a commit 29a3fe3

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/librustc_mir/repr.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,24 @@ use std::u32;
2323

2424
/// Lowered representation of a single function.
2525
pub struct Mir<'tcx> {
26+
/// List of basic blocks. References to basic block use a newtyped index type `BasicBlock`
27+
/// that indexes into this vector.
2628
pub basic_blocks: Vec<BasicBlockData<'tcx>>,
2729

30+
/// Return type of the function.
2831
pub return_ty: FnOutput<'tcx>,
2932

30-
// for every node id
31-
pub extents: FnvHashMap<CodeExtent, Vec<GraphExtent>>,
32-
33+
/// Variables: these are stack slots corresponding to user variables. They may be
34+
/// assigned many times.
3335
pub var_decls: Vec<VarDecl<'tcx>>,
36+
37+
/// Args: these are stack slots corresponding to the input arguments.
3438
pub arg_decls: Vec<ArgDecl<'tcx>>,
39+
40+
/// Temp declarations: stack slots that for temporaries created by
41+
/// the compiler. These are assigned once, but they are not SSA
42+
/// values in that it is possible to borrow them and mutate them
43+
/// through the resulting reference.
3544
pub temp_decls: Vec<TempDecl<'tcx>>,
3645
}
3746

0 commit comments

Comments
 (0)