1.4.5 Verifying the control flow graph

Having finished looping over the blocks, the context is complete.

As before, we can verify that the control flow and statements are sane by using gcc_jit_function_dump_to_dot():

gcc_jit_function_dump_to_dot (state.fn, "/tmp/factorial.dot");

and viewing the result. Note how the label names, comments, and variable names show up in the dump, to make it easier to spot errors in our compiler.

image of a control flow graph

Figure