rust/mk
Felix S. Klock II aaf398f26a Graphviz based flow graph pretty-printing.
Passing `--pretty flowgraph=<NODEID>` makes rustc print a control flow graph.

In pratice, you will also need to pass the additional option:
`-o <FILE>` to emit output to a `.dot` file for graphviz.

(You can only print the flow-graph for a particular block in the AST.)

----

An interesting implementation detail is the way the code puts both the
node index (`cfg::CFGIndex`) and a reference to the payload
(`cfg::CFGNode`) into the single `Node` type that is used for
labelling and walking the graph.  I had once mistakenly thought that I
only wanted the `cfg::CFGNode`, but for labelling, you really want the
cfg index too, rather than e.g. trying to use the `ast::NodeId` as the
label (which breaks down e.g. due to `ast::DUMMY_NODE_ID`).

----

As a drive-by fix, I had to fix `rustc::middle::cfg::construct`
interface to reflect changes that have happened on the master branch
while I was getting this integrated into the compiler.  (The next
commit actually adds tests of the `--pretty flowgraph` functionality,
so that should ensure that the `rustc::middle::cfg` code does not go
stale again.)
2014-05-15 13:50:42 -07:00
..
clean.mk mk: Don't rm 'dist' during clean, just its contents 2014-03-24 14:29:19 -07:00
crates.mk Graphviz based flow graph pretty-printing. 2014-05-15 13:50:42 -07:00
ctags.mk Don't make tags for our dependencies and tests. 2013-11-16 13:44:52 +11:00
dist.mk mk: Bundle jemalloc with make dist 2014-05-11 17:41:36 -04:00
docs.mk docs: Add a not found page 2014-05-13 17:24:07 -07:00
host.mk mk: Add libcore 2014-05-07 08:12:48 -07:00
install.mk Made 'make install' include libs for additional targets 2014-04-08 00:03:12 -07:00
llvm.mk llvm: Add an option to statically link libstdc++ 2014-04-17 11:39:51 -07:00
main.mk Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
perf.mk support for GNU configure syntax 2013-10-29 16:22:08 -07:00
platform.mk Get rid of the android-cross-path flag to rustc. 2014-05-14 02:16:14 -04:00
prepare.mk mk: Fix make install 2014-05-07 23:23:17 -07:00
reconfig.mk mk: Move most of Makefile.in to .mk files 2014-02-14 17:45:54 -08:00
rt.mk make sure jemalloc valgrind support is enabled 2014-05-11 20:05:22 -04:00
rustllvm.mk Remove VPATH usage in Makefiles 2014-02-02 10:59:14 -08:00
snap.mk support for GNU configure syntax 2013-10-29 16:22:08 -07:00
stage0.mk configure: Make rustlibdir non-configurable 2014-03-25 21:35:10 -07:00
target.mk llvm: Add an option to statically link libstdc++ 2014-04-17 11:39:51 -07:00
tests.mk mk: Don't run benchmarks with make check 2014-05-15 13:50:14 -07:00
util.mk mk: Address review feedback 2014-02-14 19:17:50 -08:00