File tree 2 files changed +29
-3
lines changed
2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,24 @@ $ dot -T pdf maybe_init_suffix.dot > maybe_init_suffix.pdf
260
260
$ firefox maybe_init_suffix.pdf # Or your favorite pdf viewer
261
261
```
262
262
263
+ ## Viewing Spanview output (.html files)
264
+ [viewing-spanview-output]: #viewing-spanview-output
265
+
266
+ In addition to [graphviz output](#formatting-graphviz-output), MIR debugging
267
+ flags include an option to generate a MIR representation called `Spanview` that
268
+ uses HTML to highlight code regions in the original source code and display
269
+ compiler metadata associated with each region.
270
+ [`-Zdump-mir-spanview`](./mir/debugging.md), for example, highlights spans
271
+ associated with each MIR `Statement`, `Terminator`, and/or `BasicBlock`.
272
+
273
+ These `.html` files use CSS features to dynamically expand spans obscured by
274
+ overlapping spans, and native tooltips (based on the HTML `title` attribute) to
275
+ reveal the actual MIR elements, as text.
276
+
277
+ To view these files, simply use a modern browser, or a CSS-capable HTML preview
278
+ feature in a modern IDE. (The default HTML preview pane in *VS Code* is known to
279
+ work, for instance.
280
+
263
281
## Narrowing (Bisecting) Regressions
264
282
265
283
The [cargo-bisect-rustc][bisect] tool can be used as a quick and easy way to
Original file line number Diff line number Diff line change 1
1
# MIR Debugging
2
2
3
- The ` -Zdump-mir ` flag can be used to dump a text representation of the MIR. The
4
- ` -Zdump-mir-graphviz ` flag can be used to dump a ` .dot ` file that represents
5
- MIR as a control-flow graph.
3
+ The ` -Zdump-mir ` flag can be used to dump a text representation of the MIR.
4
+ The following optional flags, used in combination with ` -Zdump-mir ` , enable
5
+ additional output formats, including:
6
+
7
+ * ` -Zdump-mir-graphviz ` - dumps a ` .dot ` file that represents MIR as a
8
+ control-flow graph
9
+ * ` -Zdump-mir-spanview ` - dumps an ` .html ` file that highlights the source
10
+ spans associated with MIR elements (including mouse-over actions to reveal
11
+ elements obscured by overlaps, and tooltips to view the MIR statements).
12
+ This flag takes an optional value: ` statement ` (the default), ` terminator ` , or
13
+ ` block ` , to generate span highlights with different levels of granulatity.
6
14
7
15
` -Zdump-mir=F ` is a handy compiler options that will let you view the MIR for
8
16
each function at each stage of compilation. ` -Zdump-mir ` takes a ** filter** ` F `
You can’t perform that action at this time.
0 commit comments