1.3.3 Visualizing the control flow graph

You can see the control flow graph of a function using gcc_jit_function_dump_to_dot():

gcc_jit_function_dump_to_dot (func, "/tmp/sum-of-squares.dot");

giving a .dot file in GraphViz format.

You can convert this to an image using dot:

$ dot -Tpng /tmp/sum-of-squares.dot -o /tmp/sum-of-squares.png

or use a viewer (my preferred one is xdot.py; see ‘https://github.com/jrfonseca/xdot.py’; on Fedora you can install it with yum install python-xdot):

image of a control flow graph

Figure