]> git.lizzy.rs Git - rust.git/commitdiff
Add some comments to Mir struct.
authorNiko Matsakis <niko@alum.mit.edu>
Thu, 12 Nov 2015 19:29:23 +0000 (14:29 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 24 Nov 2015 22:30:13 +0000 (17:30 -0500)
src/librustc_mir/repr.rs

index 8007f7496b4a7bf14f5b4701749501544493bd30..19b9e87701c6cc2d1ed602f449fd4abd50c3a93f 100644 (file)
 
 /// Lowered representation of a single function.
 pub struct Mir<'tcx> {
+    /// List of basic blocks. References to basic block use a newtyped index type `BasicBlock`
+    /// that indexes into this vector.
     pub basic_blocks: Vec<BasicBlockData<'tcx>>,
 
+    /// Return type of the function.
     pub return_ty: FnOutput<'tcx>,
 
-    // for every node id
-    pub extents: FnvHashMap<CodeExtent, Vec<GraphExtent>>,
-
+    /// Variables: these are stack slots corresponding to user variables. They may be
+    /// assigned many times.
     pub var_decls: Vec<VarDecl<'tcx>>,
+
+    /// Args: these are stack slots corresponding to the input arguments.
     pub arg_decls: Vec<ArgDecl<'tcx>>,
+
+    /// Temp declarations: stack slots that for temporaries created by
+    /// the compiler. These are assigned once, but they are not SSA
+    /// values in that it is possible to borrow them and mutate them
+    /// through the resulting reference.
     pub temp_decls: Vec<TempDecl<'tcx>>,
 }