Next: Tree SSA passes, Previous: Gimplification pass, Up: Passes
The pass manager is located in passes.c, tree-optimize.c and tree-pass.h. Its job is to run all of the individual passes in the correct order, and take care of standard bookkeeping that applies to every pass.
The theory of operation is that each pass defines a structure that represents everything we need to know about that pass—when it should be run, how it should be run, what intermediate language form or on-the-side data structures it needs. We register the pass to be run in some particular order, and the pass manager arranges for everything to happen in the correct order.
The actuality doesn't completely live up to the theory at present.
Command-line switches and timevar_id_t
enumerations must still
be defined elsewhere. The pass manager validates constraints but does
not attempt to (re-)generate data structures or lower intermediate
language form based on the requirements of the next pass. Nevertheless,
what is present is useful, and a far sight better than nothing at all.
Each pass may have its own dump file (for GCC debugging purposes). Passes without any names, or with a name starting with a star, do not dump anything.
TODO: describe the global variables set up by the pass manager, and a brief description of how a new pass should use it. I need to look at what info RTL passes use first....