diff options
| author | Scott Olson <scott@solson.me> | 2015-12-18 21:52:55 -0600 |
|---|---|---|
| committer | Scott Olson <scott@solson.me> | 2015-12-28 17:17:53 -0600 |
| commit | e69713db9e779850daa97e0ce1eb6af614ba5f69 (patch) | |
| tree | 863fb39811b98e21ca04fa43192318045bdc440f /src/librustc/mir | |
| parent | 9000ecf7611d732cf0a239e7c224edd6fa6d886d (diff) | |
| download | rust-e69713db9e779850daa97e0ce1eb6af614ba5f69.tar.gz rust-e69713db9e779850daa97e0ce1eb6af614ba5f69.zip | |
Add comments and simplify MIR graphviz code.
Diffstat (limited to 'src/librustc/mir')
| -rw-r--r-- | src/librustc/mir/repr.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc/mir/repr.rs b/src/librustc/mir/repr.rs index e0893476770..87c3982a36c 100644 --- a/src/librustc/mir/repr.rs +++ b/src/librustc/mir/repr.rs @@ -344,6 +344,9 @@ impl<'tcx> Debug for Terminator<'tcx> { } impl<'tcx> Terminator<'tcx> { + /// Write the "head" part of the terminator; that is, its name and the data it uses to pick the + /// successor basic block, if any. The only information not inlcuded is the list of possible + /// successors, which may be rendered differently between the text and the graphviz format. pub fn fmt_head<W: Write>(&self, fmt: &mut W) -> Result<(), Error> { use self::Terminator::*; match *self { @@ -367,6 +370,7 @@ impl<'tcx> Terminator<'tcx> { } } + /// Return the list of labels for the edges to the successor basic blocks. pub fn fmt_successor_labels(&self) -> Vec<Cow<'static, str>> { use self::Terminator::*; match *self { @@ -783,6 +787,7 @@ impl<'tcx> Debug for Literal<'tcx> { } } +/// Write a `ConstVal` in a way closer to the original source code than the `Debug` output. pub fn fmt_const_val<W: Write>(fmt: &mut W, const_val: &ConstVal) -> Result<(), Error> { use middle::const_eval::ConstVal::*; match *const_val { |
