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/)

This is a Makefile configuration relative to the src/canon/ directory. It is responsible for the integration into the libtc library with everything exported from the canon module.

File: libcanon.* (src/canon/)

The interface of the canon module. It exports two procedures, canonicalize and make_traces.

File: tasks.* (src/canon/)

Tasks related to the canon module (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: canon.* (src/canon/)

Canonicalize the intermediate representation: remove tree::Eseq, flatten nested tree::Seq

File: {exp|stm}-matcher.* (src/canon/)

Functors used to perform pattern-matching on IR for canonicalization. These make use of misc::list functions 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.