The src/canon Directory
Namespace canon, delivered for TC-6. Canonicalization and linearization
of the HIR down to LIR.
Reading the corresponding explanations in Appel’s book is mandatory.
File: local.am (src/canon/)
The Makefile configuration relative to the
src/canon/directory. It is responsible for the integration into thelibtclibrary with everything exported from thecanonmodule.
File: libcanon.* (src/canon/)
The interface of the
canonmodule. It exports two procedures,canonicalize,make_traces,basic_block_flowgraph_dumpandlir_compute.
File: tasks.* (src/canon/)
The tasks relative to the
canonmodule (see: The src/task Directory).
File: basic-block.* (src/canon/)
A basic block is a location independent piece of code, starting with a label and ending with a jump. The ordering of a program’s basic blocks has an impact on its performance.
File: basic-blocks.* (src/canon/)
The
BasicBlocksimplementation. It represents the list of basic blocks of a fragment’s trace. It is used to dump the basic block flow graph of a program.
File: canon.* (src/canon/)
Canonicalize the intermediate representation: remove
tree::Eseq, flatten nestedtree::Seq…
File: {exp|stm}-matcher.* (src/canon/)
Functors used to perform pattern-matching on IR for canonicalization. These make use of
misc::listfunctions in order to ease the writing and reading of the code which is heavily inspired from A. Appel’s functional implementation in ML.
File: traces.* (src/canon/)
Linearize the canonicalized intermediate representation to generate basic blocks.