about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-11-12 14:29:23 -0500
committerNiko Matsakis <niko@alum.mit.edu>2015-11-24 17:30:13 -0500
commit29a3fe32eb71bc2e0946d5e7c61c21157f554b5e (patch)
tree6e10524c9156087e424f14a64f5d0828d7831e99 /src
parent2a0ce4a62954ad30f37d67f1c47b1a6978fc6bc4 (diff)
downloadrust-29a3fe32eb71bc2e0946d5e7c61c21157f554b5e.tar.gz
rust-29a3fe32eb71bc2e0946d5e7c61c21157f554b5e.zip
Add some comments to Mir struct.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/repr.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/librustc_mir/repr.rs b/src/librustc_mir/repr.rs
index 8007f7496b4..19b9e87701c 100644
--- a/src/librustc_mir/repr.rs
+++ b/src/librustc_mir/repr.rs
@@ -23,15 +23,24 @@ use std::u32;
 
 /// 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>>,
 }