3.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 gccjit;;function;;dump_to_dot():

fn.dump_to_dot ("/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