Directly generating .vcg files from LLVM will require heavy modifications to GraphWriter, which is very GraphViz-specific. Instead, it seems to me that the most straightforward solution will be to save a dot file (via -dot-cfg
instead of -view-cfg
) and then convert it, using something like Graph-Easy. From its documentation (emphasis mine):
It understands the following formats as input:
- Graph::Easy http://bloodgate.com/perl/graph/manual/
- DOT http://www.graphviz.org/
- VCG http://rw4.cs.uni-sb.de/~sander/html/gsvcg1.html
- GDL http://www.aisee.com/
The output can be a dump of the graph in one of the following formats:
By the way, if you want to get a lot of graphs and prefer to see them before generating a lot of dot files, consider using a dot viewer which also allows you to save the file, such as my fork of xdot.py - or better yet, modify xdot.py
so that it knows how to save in .vcg format itself, using Graph-Easy.
Another alternative to Graph-Easy appears to be dot2gdl.