Chris Lattner
2002-Oct-07 14:06 UTC
[LLVMdev] New 'analyze' pass for printing CFG as a graph
I just checked in a new analyze pass that may be useful for people... which converts the CFG of a function into a graph for easy printing or visualization. Since I thought this might be useful for other people using LLVM, I thought I'd tell you all about it. Basically do this: analyze -print-cfg foo.bc This will cause a bunch of 'dot' files to be written to the disk (one for each function). Using the 'dot' tool (http://www.research.att.com/sw/tools/graphviz/), you can convert these to a variety of formats, including postscript. Just do: dot -Tps < cfg.main.dot > cfg.main.ps to make a postscript file out of the CFG for 'main'. If you're on our research machines, you can use my install of dot, which is here: /home/vadve/lattner/local/x86/bin/dot /home/vadve/lattner/local/sparc/bin/dot Have fun, -Chris http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/