Sometimes understanding the dataflow results is difficult without looking at the actual MIR control-flow graph being processed with the corresponding GEN and KILL sets.
For a graphviz-rendering with dataflow annotations, add the attribute #[rustc_mir(borrowck_graphviz_postflow="/path/to/suffix.dot")]
to the function in question. (You can change the content of "suffix.dot"
to control the filenames used for the output). This will generate a separate file for each dataflow analysis, adding a prefix (corresponding to the name of the analysis) to the filename in each generated output path.
For example, the above attribute will currently cause two files to be generated: /path/to/maybe_init_suffix.dot
and /path/to/maybe_uninit_suffix.dot
.
The generated .dot
file shows both the computed dataflow results on entry to each block, as well as the gen- and kill-sets that were so-called “transfer functions” summarizing the effect of each basic block.